package com.wpzf.zxhc.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.wpzf.common.core.utils.StringUtils;
import com.wpzf.common.core.utils.sign.Base64;
import com.wpzf.common.core.web.domain.AjaxResult;
import com.wpzf.common.log.annotation.Log;
import com.wpzf.common.log.enums.BusinessType;
import com.wpzf.ndhc.domain.*;
import com.wpzf.ndhc.mapper.*;
import com.wpzf.ndhc.utils.MyObjectUtil;
import com.wpzf.zxhc.domain.*;
import com.wpzf.zxhc.mapper.*;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.io.*;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Date;
import java.util.concurrent.CompletableFuture;

import org.sqlite.mc.SQLiteMCSqlCipherConfig;

@RestController
@RequestMapping("/totop")
public class WpzfInfoTranslateController {
    @Autowired
    private SqlSessionFactory sqlSessionFactory;

    @Autowired
    public WpzfInfoTranslateMapper wpzfInfoTranslateMapper;


    @Value("${tempath}")
    public String tempath;


    @Autowired
    public XjtbTbBaseMapper xjtbTbBaseMapper;

    @Autowired
    public WpzfTbBaseMapper wpzfTbBaseMapper;

    @Log(title = "获取年度和季度 国土云图斑信息  年度和季度使用同一个接口 全部为DB包", businessType = BusinessType.OTHER)
    //获取季度图斑信息  增量 DB包格式  每次下发为增量
    @RequestMapping(value = "/getjdtbxxbInfo", method = RequestMethod.POST)
    public AjaxResult getjdtbxxbInfo(@RequestBody Map<String, Object> parm) throws SQLException, SQLException, MalformedURLException {
        CompletableFuture.runAsync(() -> {
            try {
                System.out.println("文件开始下载。");
                String dbPath = parm.get("url").toString(); //db路径
                String dbType = parm.get("code").toString(); //db路径 WPZF2024_ND  WPZF2024

                String fileName = dbPath.substring(dbPath.lastIndexOf("/") + 1);
                dbPath = downloadByIO(dbPath, tempath, fileName);
                //tempath+"//000000_20240910134256.db";
                //downloadByIO(dbPath, tempath, fileName);
                File file = new File(dbPath);
                if (file.exists()) {
                    Integer tbcount = Integer.parseInt(parm.get("count").toString()); //图斑数量
                    String dbPass = "ueNSC7tyhMu1";//db密码
                    String fileurl = "jdbc:sqlite:" + dbPath;
                    Connection connection = null;
                    if (dbType.equals("WPZF2024")) {
                        dbPass = "ueNSC7tyhMu1";//db密码
                        String nf = dbType.substring(4, 8);
                        List<WpCjTbxxbxj2023DTO> tbxxbxj2023DTOList = new ArrayList<WpCjTbxxbxj2023DTO>();
                        try {
                            connection = SQLiteMCSqlCipherConfig.getV3Defaults().withKey(dbPass).build().createConnection(fileurl);
                            Statement statement = connection.createStatement();
                            statement.setQueryTimeout(30);  // set timeout to 30 sec.
                            ResultSet rs = statement.executeQuery("select * from wpzftb");
                            while (rs.next()) {
                                WpCjTbxxbxj2023DTO model = new WpCjTbxxbxj2023DTO();
                                model.setNf(nf);
                                model.setPcxx(MyObjectUtil.objectIsNullToString(rs.getString("xfpc")).toString());
                                model.setTbxfsj(MyObjectUtil.objectIsNullToString(rs.getString("jcrq")).toString());
                                model.setSmc(MyObjectUtil.objectIsNullToString(rs.getString("smc")).toString());
                                model.setQxmc(MyObjectUtil.objectIsNullToString(rs.getString("xzqmc")).toString());
                                model.setXzqdm(MyObjectUtil.objectIsNullToString(rs.getString("xzqdm")).toString());
                                model.setJcbh(MyObjectUtil.objectIsNullToString(rs.getString("jcbh")).toString());
                                model.setQsx(MyObjectUtil.objectIsNullToString(rs.getString("qsx")).toString());
                                model.setHsx(MyObjectUtil.objectIsNullToString(rs.getString("hsx")).toString());
                                model.setQsxdz(MyObjectUtil.objectIsNullToString(rs.getString("qsxdz")).toString());
                                model.setHsxdz(MyObjectUtil.objectIsNullToString(rs.getString("hsxdz")).toString());
                                model.setQsxtif(MyObjectUtil.objectIsNullToString(rs.getString("qsx_tif")).toString().replace("jpg", "tif"));
                                model.setHsxtif(MyObjectUtil.objectIsNullToString(rs.getString("hsx_tif")).toString().replace("jpg", "tif"));
                                model.setHyjgurl(MyObjectUtil.objectIsNullToString(rs.getString("hyjg_url")).toString());
                                model.setDqjh(MyObjectUtil.objectIsNullToString(rs.getString("dqjh")).toString());
                                model.setJcmj(MyObjectUtil.objectIsNullToDouble(rs.getString("jcmj")));
                                model.setWqtbbh(MyObjectUtil.objectIsNullToString(rs.getString("wqbh")).toString());
                                model.setBz(MyObjectUtil.objectIsNullToString(rs.getString("bz")).toString());
                                model.setJctbxzgdmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdgdmj")));
                                model.setJctbxznydzmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdnydmj")));
                                model.setDlrdjsydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdjsydmj")));
                                model.setDlrdwlydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdwlydmj")));
                                model.setZjbntmj(MyObjectUtil.objectIsNullToDouble(rs.getString("jbntmj")));

                                model.setMjzbzddsdxjxzqdm(MyObjectUtil.objectIsNullToString(rs.getString("tb_xzqdm_max_2023")).toString());
                                model.setMjzbzddsdxjxzqmc(MyObjectUtil.objectIsNullToString(rs.getString("tb_xzqmc_max_2023")).toString());

                                model.setMjzbzddxzjxzqmc(MyObjectUtil.objectIsNullToString(rs.getString("tb_xzjxzqmc_2022")).toString());
                                model.setMjzbzddxzjxzqdm(MyObjectUtil.objectIsNullToString(rs.getString("tb_xzjxzqdm_2022")).toString());
                                model.setMjzbzddcjxzqdm(MyObjectUtil.objectIsNullToString(rs.getString("tb_cjxzqdm_2022")).toString());
                                model.setMjzbzddcjxzqmc(MyObjectUtil.objectIsNullToString(rs.getString("tb_cjxzqmc_2022")).toString());
                                model.setNzyjsydxmtbzj(MyObjectUtil.objectIsNullToString(rs.getString("nzy")).toString());
                                model.setTdzzysxm(MyObjectUtil.objectIsNullToString(rs.getString("tdzz")).toString());
                                model.setZjggxmcjq(MyObjectUtil.objectIsNullToString(rs.getString("zjgcj")).toString());
                                model.setZjggxmjxq(MyObjectUtil.objectIsNullToString(rs.getString("zjgxj")).toString());
                                model.setGdxx(MyObjectUtil.objectIsNullToString(rs.getString("gdxxmj")).toString());
                                model.setSsnydxx(MyObjectUtil.objectIsNullToString(rs.getString("ssnydmj")).toString());
                                model.setWkt(MyObjectUtil.objectIsNullToString(rs.getString("shape")).toString());
                                model.setYsxwpdlrdgdmj(MyObjectUtil.objectIsNullToDouble(rs.getString("ysx_dlrdgdmj")));
                                model.setYsxwpdlrdnydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("ysx_dlrdnydmj")));
                                model.setYsxwpdlrdjsydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("ysx_dlrdjsydmj")));
                                model.setYsxwpdlrdwlydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("ysx_dlrdwlydmj")));
                                model.setYsxwpdlrdjbntmj(MyObjectUtil.objectIsNullToDouble(rs.getString("ysx_dlrdjbntmj")));

                                model.setWsxwpdlrdgdmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdgdmj")));
                                model.setWsxwpdlrdnydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdnydmj")));
                                model.setWsxwpdlrdjsydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdjsydmj")));
                                model.setWsxwpdlrdwlydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdwlydmj")));
                                model.setWsxwpdlrdstmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdstmj")));
                                model.setWsxwpdlrdjbntmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdjbntmj")));
                                model.setIscl("0");
                                model.setTbbsm(MyObjectUtil.objectIsNullToString(rs.getString("tbbsm")).toString());
                                model.setPch(MyObjectUtil.objectIsNullToString(rs.getString("xfpc")).toString());
                                model.setOpTime((new Date()).toString());
                                model.setGjxfhzztq("");
                                model.setId(random.nextInt());
                                tbxxbxj2023DTOList.add(model);
                            }
                        } catch (SQLException e) {
                            // if the error message is "out of memory",
                            // it probably means no database file is found
                            System.err.println(e.getMessage());
                        } finally {
                            try {
                                if (connection != null)
                                    connection.close();
                            } catch (SQLException e) {
                                // connection close failed.
                                System.err.println(e.getMessage());
                            }
                        }
                        boolean b = InsertBatch(tbxxbxj2023DTOList);
                        if (b) {
                            if (tbcount.equals(tbxxbxj2023DTOList.size())) {
                                //导入地块
                                System.out.println("导入图斑信息成功");
                                //导入地块信息 表
                                List<WpCjDkxxbxj2023DTO> dkmodels = new ArrayList<WpCjDkxxbxj2023DTO>();
                                WpCjDkxxbxj2023DTO dkmodel = new WpCjDkxxbxj2023DTO();
                                for (int i = 0; i < tbxxbxj2023DTOList.size(); i++) {
                                    WpCjTbxxbxj2023DTO model = tbxxbxj2023DTOList.get(i);
                                    if (model.getXzqdm().startsWith("21")) //辽宁省 直接产生地块信息 便于分配
                                    {
                                        dkmodel = new WpCjDkxxbxj2023DTO();
                                        dkmodel.setXzqdm(model.getXzqdm());
                                        dkmodel.setTbbh(model.getJcbh());
                                        dkmodel.setDkbh(model.getJcbh());
                                        dkmodel.setThdkmj(model.getJcmj());
                                        dkmodel.setThdkgdmj(model.getJctbxzgdmj());
                                        dkmodel.setThdkzjbntmj(model.getZjbntmj());
                                        dkmodel.setThnydmj(model.getJctbxznydzmj());
                                        dkmodel.setThdkstmj(model.getWsxwpdlrdstmj());

                                        dkmodel.setTbdkmj(model.getJcmj());
                                        dkmodel.setTbdkqzgdmj(model.getJctbxzgdmj());
                                        dkmodel.setTbdkqzjbntmj(model.getZjbntmj());
                                        dkmodel.setTbnydmj(model.getJctbxznydzmj());
                                        dkmodel.setTbdkstmj(model.getWsxwpdlrdstmj());
                                        dkmodel.setTbdkstbhhxmj(0.00);

                                        dkmodel.setJcbh(model.getJcbh());
                                        dkmodel.setXian(model.getQxmc());
                                        dkmodel.setShi(model.getSmc1());
                                        dkmodel.setWkt(model.getWkt().split(";")[0].toString());
                                        dkmodel.setUid(UUID.randomUUID().toString().replace("-", ""));
                                        dkmodel.setPch(model.getPch());
                                        dkmodel.setIsdel("0");
                                        dkmodels.add(dkmodel);
                                    }
                                }
                                if (dkmodels.size() > 0) {
                                    b = InsertBatch1(dkmodels);
                                }
                                System.out.println("图斑导入成功" + tbxxbxj2023DTOList.size());
                            } else {
                                System.out.println("图斑数量导入不一致" + tbxxbxj2023DTOList.size() + "/" + tbcount);
                            }
                        } else {
                            System.out.println("图斑导入失败");
                        }
                    } else if (dbType.equals("WPZF2024_ND")) //接收年底图斑
                    {
                        dbPass = "gmcu7ukNLJNXjBX3vYQS1Cgi";
                        System.out.println("接收年度图斑");
                        String nf = dbType.substring(4, 8);
                        List<WpCjTbxxb2024DTO> tbxxbDTOList = new ArrayList<WpCjTbxxb2024DTO>();
                        try {
                            connection = SQLiteMCSqlCipherConfig.getV3Defaults().withKey(dbPass).build().createConnection(fileurl);
                            Statement statement = connection.createStatement();
                            statement.setQueryTimeout(30);  // set timeout to 30 sec.
                            ResultSet rs = statement.executeQuery("select * from wpzftb");
                            while (rs.next()) {

                                System.out.println(MyObjectUtil.objectIsNullToString(rs.getString("jcbh")).toString());
                                WpCjTbxxb2024DTO model = new WpCjTbxxb2024DTO();
                                model.setNf(nf);
                                model.setTbbsm(MyObjectUtil.objectIsNullToString(rs.getString("tbbsm")).toString());
                                model.setXzqdm(MyObjectUtil.objectIsNullToString(rs.getString("xzqdm")).toString());
                                model.setQxmc(MyObjectUtil.objectIsNullToString(rs.getString("xzqmc")).toString());
                                model.setMjzbzddxzjxzqdm(MyObjectUtil.objectIsNullToString(rs.getString("xzdm")).toString());
                                model.setMjzbzddxzjxzqmc(MyObjectUtil.objectIsNullToString(rs.getString("xzmc")).toString());
                                model.setJcbh(MyObjectUtil.objectIsNullToString(rs.getString("jcbh")).toString());
                                model.setTblx(MyObjectUtil.objectIsNullToString(rs.getString("tblx")));
                                model.setTbtz(MyObjectUtil.objectIsNullToString(rs.getString("tbtz")).toString());
                                model.setHsx(MyObjectUtil.objectIsNullToString(rs.getString("hsx")).toString());
                                model.setJcmj(MyObjectUtil.objectIsNullToDouble(rs.getString("jcmj")));
                                model.setJctqmj(MyObjectUtil.objectIsNullToDouble(rs.getString("jctqmj")));
                                model.setBz(MyObjectUtil.objectIsNullToString(rs.getString("bz")).toString());
                                model.setDlrdnydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdnydmj")));
                                model.setDlrdgdmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdgdmj")));
                                model.setQtnydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("qtnydmj")));
                                model.setDlrdjsydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdjsydmj")));
                                model.setDlrdwlydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdwlydmj")));
                                model.setNzyjsydxmtbzj(MyObjectUtil.objectIsNullToString(rs.getString("nzy")).toString());
                                model.setZjggxmjxq(MyObjectUtil.objectIsNullToString(rs.getString("zjgxj")).toString());
                                model.setXxydxx(MyObjectUtil.objectIsNullToString(rs.getString("xxydmj")).toString());
                                model.setWlydkfxm(MyObjectUtil.objectIsNullToString(rs.getString("wly")).toString());
                                model.setZjggxmcjq(MyObjectUtil.objectIsNullToString(rs.getString("zjgcj")).toString());
                                model.setTdzzysxm(MyObjectUtil.objectIsNullToString(rs.getString("tdzz")).toString());
                                model.setGkfqdfkxm(MyObjectUtil.objectIsNullToString(rs.getString("gkfq")).toString());
                                model.setSsnydxx(MyObjectUtil.objectIsNullToString(rs.getString("ssnydmj")).toString());
                                model.setLsydmj(MyObjectUtil.objectIsNullToString(rs.getString("lsydmj")).toString());
                                model.setKqxx(MyObjectUtil.objectIsNullToString(rs.getString("fist_kyq")).toString());
                                model.setZjbntmj(MyObjectUtil.objectIsNullToDouble(rs.getString("jbntmj")));
                                model.setStbhhxmj(MyObjectUtil.objectIsNullToString(rs.getString("stbhhxmj")).toString());
                                model.setSxsj(MyObjectUtil.objectIsNullToString(rs.getString("sxsj")).toString());
                                model.setHsxdz(MyObjectUtil.objectIsNullToString(rs.getString("hsxdz")).toString());
                                model.setHsxtif(MyObjectUtil.objectIsNullToString(rs.getString("hsxdz_tif")).toString());
                                model.setHyjgurl(MyObjectUtil.objectIsNullToString(rs.getString("hyjg_url")).toString());
                                model.setTbzxdjd(MyObjectUtil.objectIsNullToString(rs.getString("longitude")).toString());
                                model.setTbzxdwd(MyObjectUtil.objectIsNullToString(rs.getString("latitude")).toString());
                                model.setWkt(MyObjectUtil.objectIsNullToString(rs.getString("shape")).toString());
                                model.setMaxx(MyObjectUtil.objectIsNullToDouble(rs.getString("maxx")));
                                model.setMinx(MyObjectUtil.objectIsNullToDouble(rs.getString("minx")));
                                model.setMaxy(MyObjectUtil.objectIsNullToDouble(rs.getString("maxy")));
                                model.setMiny(MyObjectUtil.objectIsNullToDouble(rs.getString("miny")));
                                model.setSjdrly(MyObjectUtil.objectIsNullToString(rs.getString("sjdrly")).toString());
                                model.setCreatetime(MyObjectUtil.objectIsNullToString(rs.getString("createtime")).toString());
                                model.setModifytime(MyObjectUtil.objectIsNullToString(rs.getString("modifytime")).toString());
                                model.setIscl("0");
                                model.setPch("年度卫片（试点）");
                                model.setOpTime((new Date()).toString());
                                model.setGjxfhzztq("");
                                model.setId(random.nextInt());
                                tbxxbDTOList.add(model);
                            }
                        } catch (SQLException e) {
                            // if the error message is "out of memory",
                            // it probably means no database file is found
                            System.err.println(e.getMessage());
                        } finally {
                            try {
                                if (connection != null)
                                    connection.close();
                            } catch (SQLException e) {
                                // connection close failed.
                                System.err.println(e.getMessage());
                            }
                        }
                        boolean b = InsertBatchtbxxb(tbxxbDTOList);
                        if (b) {
                            if (tbcount.equals(tbxxbDTOList.size())) {
                                System.out.println("年度图斑导入成功" + tbxxbDTOList.size());
                            } else {
                                System.out.println("年度图斑数量导入不一致" + tbxxbDTOList.size() + "/" + tbcount);
                            }
                        } else {
                            System.out.println("年度图斑导入失败");
                        }
                    } else if (dbType.equals("WPZFSJMKTB")) //接收 卫片执法省级模块图斑
                    {
                        dbPass = "iL0t7ExeMpxzC";//db密码
                        String nf = dbType.substring(4, 8);
                        List<WpCjTbxxbxj2023DTO> tbxxbxj2023DTOList = new ArrayList<WpCjTbxxbxj2023DTO>();
                        try {
                            connection = SQLiteMCSqlCipherConfig.getV3Defaults().withKey(dbPass).build().createConnection(fileurl);
                            Statement statement = connection.createStatement();
                            statement.setQueryTimeout(30);  // set timeout to 30 sec.
                            ResultSet rs = statement.executeQuery("select * from wpzfsjmktb");
                            while (rs.next()) {
                                WpCjTbxxbxj2023DTO model = new WpCjTbxxbxj2023DTO();
                                model.setNf("2024");
                                model.setPcxx("自主提取");
                                model.setTbxfsj(MyObjectUtil.objectIsNullToString(rs.getString("jcrq")).toString());
                                model.setSmc(MyObjectUtil.objectIsNullToString(rs.getString("smc")).toString());
                                model.setQxmc(MyObjectUtil.objectIsNullToString(rs.getString("xzqmc")).toString());
                                model.setXzqdm(MyObjectUtil.objectIsNullToString(rs.getString("xzqdm")).toString());
                                model.setJcbh(MyObjectUtil.objectIsNullToString(rs.getString("jcbh")).toString());
                                model.setQsx(MyObjectUtil.objectIsNullToString(rs.getString("qsx")).toString());
                                model.setHsx(MyObjectUtil.objectIsNullToString(rs.getString("hsx")).toString());
                                model.setQsxdz(MyObjectUtil.objectIsNullToString(rs.getString("qsxdz")).toString());
                                model.setHsxdz(MyObjectUtil.objectIsNullToString(rs.getString("hsxdz")).toString());
                                model.setQsxtif(MyObjectUtil.objectIsNullToString(rs.getString("qsx_tif")).toString().replace("jpg", "tif"));
                                model.setHsxtif(MyObjectUtil.objectIsNullToString(rs.getString("hsx_tif")).toString().replace("jpg", "tif"));
                                model.setHyjgurl(MyObjectUtil.objectIsNullToString(rs.getString("hyjg_url")).toString());
                                model.setDqjh(MyObjectUtil.objectIsNullToString(rs.getString("dqjh")).toString());
                                model.setJcmj(MyObjectUtil.objectIsNullToDouble(rs.getString("jcmj")));
                                model.setWqtbbh(MyObjectUtil.objectIsNullToString(rs.getString("wqbh")).toString());
                                model.setBz(MyObjectUtil.objectIsNullToString(rs.getString("bz")).toString());
                                model.setJctbxzgdmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdgdmj")));
                                model.setJctbxznydzmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdnydmj")));
                                model.setDlrdjsydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdjsydmj")));
                                model.setDlrdwlydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("dlrdwlydmj")));
                                model.setZjbntmj(MyObjectUtil.objectIsNullToDouble(rs.getString("jbntmj")));
                                model.setMjzbzddsdxjxzqdm(MyObjectUtil.objectIsNullToString(rs.getString("tb_xzqdm_max_2023")).toString());
                                model.setMjzbzddsdxjxzqmc(MyObjectUtil.objectIsNullToString(rs.getString("tb_xzqmc_max_2023")).toString());
                                model.setMjzbzddxzjxzqmc(MyObjectUtil.objectIsNullToString(rs.getString("tb_xzjxzqmc_2022")).toString());
                                model.setMjzbzddxzjxzqdm(MyObjectUtil.objectIsNullToString(rs.getString("tb_xzjxzqdm_2022")).toString());
                                model.setMjzbzddcjxzqdm(MyObjectUtil.objectIsNullToString(rs.getString("tb_cjxzqdm_2022")).toString());
                                model.setMjzbzddcjxzqmc(MyObjectUtil.objectIsNullToString(rs.getString("tb_cjxzqmc_2022")).toString());
                                model.setNzyjsydxmtbzj(MyObjectUtil.objectIsNullToString(rs.getString("nzy")).toString());
                                model.setTdzzysxm(MyObjectUtil.objectIsNullToString(rs.getString("tdzz")).toString());
                                model.setZjggxmcjq(MyObjectUtil.objectIsNullToString(rs.getString("zjgcj")).toString());
                                model.setZjggxmjxq(MyObjectUtil.objectIsNullToString(rs.getString("zjgxj")).toString());
                                model.setGdxx(MyObjectUtil.objectIsNullToString(rs.getString("gdxxmj")).toString());
                                model.setSsnydxx(MyObjectUtil.objectIsNullToString(rs.getString("ssnydmj")).toString());
                                model.setWkt(MyObjectUtil.objectIsNullToString(rs.getString("shape")).toString());
                                model.setYsxwpdlrdgdmj(MyObjectUtil.objectIsNullToDouble(rs.getString("ysx_dlrdgdmj")));
                                model.setYsxwpdlrdnydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("ysx_dlrdnydmj")));
                                model.setYsxwpdlrdjsydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("ysx_dlrdjsydmj")));
                                model.setYsxwpdlrdwlydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("ysx_dlrdwlydmj")));
                                model.setYsxwpdlrdjbntmj(MyObjectUtil.objectIsNullToDouble(rs.getString("ysx_dlrdjbntmj")));
                                model.setWsxwpdlrdgdmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdgdmj")));
                                model.setWsxwpdlrdnydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdnydmj")));
                                model.setWsxwpdlrdjsydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdjsydmj")));
                                model.setWsxwpdlrdwlydmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdwlydmj")));
                                model.setWsxwpdlrdstmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdstmj")));
                                model.setWsxwpdlrdjbntmj(MyObjectUtil.objectIsNullToDouble(rs.getString("wsx_dlrdjbntmj")));
                                model.setIscl("0");
                                model.setTbbsm(MyObjectUtil.objectIsNullToString(rs.getString("tbbsm")).toString());
                                model.setPch("自主提取");
                                model.setOpTime((new Date()).toString());
                                model.setGjxfhzztq("");
                                model.setId(random.nextInt());
                                tbxxbxj2023DTOList.add(model);
                            }
                        } catch (SQLException e) {
                            // if the error message is "out of memory",
                            // it probably means no database file is found
                            System.err.println(e.getMessage());
                        } finally {
                            try {
                                if (connection != null)
                                    connection.close();
                            } catch (SQLException e) {
                                // connection close failed.
                                System.err.println(e.getMessage());
                            }
                        }
                        boolean b = InsertBatch(tbxxbxj2023DTOList);
                        if (b) {
                            if (tbcount.equals(tbxxbxj2023DTOList.size())) {
                                System.out.println("图斑导入成功" + tbxxbxj2023DTOList.size());
                            } else {
                                System.out.println("图斑数量导入不一致" + tbxxbxj2023DTOList.size() + "/" + tbcount);
                            }
                        } else {
                            System.out.println("图斑导入失败");
                        }
                    } else {
                        System.out.println("dbType不在规定字典内");
                    }
                } else {
                    System.out.println("图斑下载失败");
                }
                System.out.println("文件下载完成。");
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        return AjaxResult.success("已接收信息，准备下载文件。");
    }

    @Transactional
    @Log(title = "获取季度国土云地块信息  到达省级节点 省级核查", businessType = BusinessType.OTHER)
    //获取季度地块信息
    @RequestMapping(value = "/getjddkxxbInfo", method = RequestMethod.POST)
    public AjaxResult getjddkxxbInfo(@RequestBody Map<String, Object> parm) {
        System.out.println(parm);
        try {
            String xzqdm = parm.get("xzqdm").toString();
            String tbbh = parm.get("tbbh").toString();
            String state = parm.get("state").toString();

            if (!xzqdm.startsWith("21"))  //除了辽宁外 其他均推送
            {
                if (("-1").equals(state)) //-1 为撤回 删除 dkxxb
                {
                    try {
                        //暂时删除 后续备份处理
                        int k = wpzfInfoTranslateMapper.deleteDkxxb(parm);
                        if (k > -1) {
                            String jcbh = tbbh;
                            //更新tbxxb 的填报状态  查询是否有其他地块
                            if (jcbh.indexOf(",") != -1) {
                                parm.put("jcbh", jcbh.split("-")[0]);
                            }
                            parm.put("jcbh", jcbh.split("-")[0]);
                            List<WpCjDkxxbxj2023DTO> list1 = wpzfInfoTranslateMapper.queryDkxxbxj(parm);
                            if (list1 != null && list1.size() == 0) {
                                //更新tbxxb的状态
                                int count2 = xjtbTbBaseMapper.updateTbxxbXjSaveState1(parm); //iscl 设置为 1
                                System.out.println("tbxxb状态修改为未填报");
                            }
                            k = wpzfInfoTranslateMapper.deletefjinfo(parm);
                            k = wpzfInfoTranslateMapper.deletepwinfo(parm);
                            k = wpzfInfoTranslateMapper.deleteshijHcjg(parm);
                            k = wpzfInfoTranslateMapper.deleteHcJg(parm);
                            k = wpzfInfoTranslateMapper.deleteHcjg_hf_dtPwwj(parm);
                            k = wpzfInfoTranslateMapper.deleteHcjg_wf_wfpzwh(parm);
                            k = wpzfInfoTranslateMapper.deleteHcjg_wf_wftgzmwj(parm);
                            k = wpzfInfoTranslateMapper.deleteHcjg_qt_qtpzwh(parm);
                            k = wpzfInfoTranslateMapper.deleteHcjg_qt_qtsftgxxydss(parm);
                            k = wpzfInfoTranslateMapper.deleteHcjg_qt_qtsfzygd(parm);
                            return AjaxResult.success(tbbh + "地块已撤回");
                        } else {
                            return AjaxResult.error(tbbh + "地块撤回失败");
                        }
                    } catch (Exception ex) {
                        return AjaxResult.error(tbbh + "地块撤回失败", ex.toString());
                    }
                } else //默认为推送
                {
                    {
                        String postURL = "";
                        String data = "";
                        {
                            postURL = "https://jg.landcloud.org.cn:8553/webapi/token";
                            data = "client_id=web&client_secret=e46232c20609435eba54b7576de935dd&grant_type=password&username=a53e0c14ee900728f36bba014d975982&password=b30c775c48e9ba92ade95e427a5242b0";
                        }
                        URL url = new URL(postURL);
                        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                        conn.setRequestMethod("POST");
                        conn.setRequestProperty("accept", "*/*");
                        conn.setRequestProperty("connection", "Keep-Alive");
                        conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");

                        conn.setDoOutput(true);
                        conn.setDoInput(true);
                        OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "utf-8");

                        out.write(data);
                        //缓冲数据
                        out.flush();
                        //获取URLConnection对象对应的输入流
                        InputStream is = conn.getInputStream();
                        int count = 0;
                        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                        byte[] buffer = new byte[4096];
                        while ((count = is.read(buffer)) != -1) {
                            byteArrayOutputStream.write(buffer, 0, count);
                        }
                        byte[] datas = byteArrayOutputStream.toByteArray();
                        byteArrayOutputStream.close();
                        //关闭流
                        is.close();
                        conn.disconnect();
                        String result = new String(datas, 0, datas.length, "utf-8");
                        int k = wpzfInfoTranslateMapper.deleteDkxxb(parm);
                        k = wpzfInfoTranslateMapper.deletefjinfo(parm);
                        k = wpzfInfoTranslateMapper.deletepwinfo(parm);
                        String str = getDxxxb(result, "00gty_wpzf_dk", xzqdm, tbbh); //区县所有地块信息
                        if (str.equals("")) {
                            //入库后 更新tbxxb的状态
                            return AjaxResult.success(tbbh + "地块入库成功");
                        } else {
                            return AjaxResult.error(tbbh + "地块入库失败:" + str);
                        }
                    }


                }
            } else {
                return AjaxResult.success("辽宁省地块无需处理");
            }

        } catch (Exception ex) {
            return AjaxResult.error("地块入库失败", ex.toString());
        }
    }

    @Transactional
    @Log(title = "获取年度国土云地块信息  到达国家级节点 国家级核查", businessType = BusinessType.OTHER)
    //获取季度地块信息
    @RequestMapping(value = "/getnddkxxbInfo", method = RequestMethod.POST)
    public AjaxResult getnddkxxbInfo(@RequestBody Map<String, Object> parm) {
        System.out.println(parm);
        try {
            String xzqdm = parm.get("xzqdm").toString();
            String tbbh = parm.get("tbbh").toString();
            String state = parm.get("state").toString();
            if (("-1").equals(state)) //-1 为撤回 删除 dkxxb
            {
                //年度的无撤回操作
//                try {
//                    //暂时删除 后续备份处理
//                    int k = wpzfInfoTranslateMapper.deleteDkxxb2024(parm);
//                    if (k > -1) {
//                        String jcbh=tbbh;
//                        //更新tbxxb 的填报状态  查询是否有其他地块
//                        if (jcbh.indexOf(",") != -1) {
//                            parm.put("jcbh", jcbh.split("-")[0]);
//                        }
//                        parm.put("jcbh", jcbh.split("-")[0]);
//                        List<WpCjDkxxbxj2023DTO>  list1=wpzfInfoTranslateMapper.queryDkxxbxj(parm);
//                        if(list1!=null && list1.size()==0)
//                        {
//                            //更新tbxxb的状态
//                            int count2= xjtbTbBaseMapper.updateTbxxbXjSaveState1(parm); //iscl 设置为 1
//                            System.out.println("tbxxb状态修改为未填报");
//                        }
//                        k = wpzfInfoTranslateMapper.deletefjinfo(parm);
//                        k = wpzfInfoTranslateMapper.deletepwinfo(parm);
//                        k = wpzfInfoTranslateMapper.deleteshijHcjg(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcJg(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_hf_dtPwwj(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_wf_wfpzwh(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_wf_wftgzmwj(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_qt_qtpzwh(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_qt_qtsftgxxydss(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_qt_qtsfzygd(parm);
//                        return AjaxResult.success(tbbh + "地块已撤回");
//                    } else {
//                        return AjaxResult.error(tbbh + "地块撤回失败");
//                    }
//                }
//                catch (Exception ex)
//                {
//                    return AjaxResult.error(tbbh + "地块撤回失败",ex.toString());
//                }
                return AjaxResult.error(tbbh + "地块撤回失败");
            } else //默认为推送
            {
                String postURL = "";
                String data = "";
                {
                    postURL = "https://jg.landcloud.org.cn:8553/webapi/token";
                    data = "client_id=web&client_secret=e46232c20609435eba54b7576de935dd&grant_type=password&username=a53e0c14ee900728f36bba014d975982&password=b30c775c48e9ba92ade95e427a5242b0";
                }
                URL url = new URL(postURL);
                HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                conn.setRequestMethod("POST");
                conn.setRequestProperty("accept", "*/*");
                conn.setRequestProperty("connection", "Keep-Alive");
                conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");

                conn.setDoOutput(true);
                conn.setDoInput(true);
                OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "utf-8");

                out.write(data);
                //缓冲数据
                out.flush();
                //获取URLConnection对象对应的输入流
                InputStream is = conn.getInputStream();
                int count = 0;
                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                byte[] buffer = new byte[4096];
                while ((count = is.read(buffer)) != -1) {
                    byteArrayOutputStream.write(buffer, 0, count);
                }
                byte[] datas = byteArrayOutputStream.toByteArray();
                byteArrayOutputStream.close();
                //关闭流
                is.close();
                conn.disconnect();
                String result = new String(datas, 0, datas.length, "utf-8");
                int k = wpzfInfoTranslateMapper.deleteDkxxb2024(parm);
                k = wpzfInfoTranslateMapper.deletefj2024info(parm);
                k = wpzfInfoTranslateMapper.deletepw2024info(parm);
                // 00gty_wpzf_nddk 年度地块
                String str = getNDDxxxb(result, "00gty_wpzf_nddk", xzqdm, tbbh); //年度地块信息
                if (str.equals("")) {
                    //入库后 更新tbxxb的状态
                    return AjaxResult.success(tbbh + "地块入库成功");
                } else {
                    return AjaxResult.error(tbbh + "地块入库失败:" + str);
                }

            }
        } catch (Exception ex) {
            return AjaxResult.error("地块入库失败", ex.toString());
        }
    }


    @Transactional
    @Log(title = "获取年度国土云地块信息 并存储 到达省级节点 省级核查", businessType = BusinessType.OTHER)
    //获取季度地块信息
    @RequestMapping(value = "/getnddkxxbsjInfo", method = RequestMethod.POST)
    public AjaxResult getnddkxxbsjInfo(@RequestBody Map<String, Object> parm) {
        try {
            String xzqdm = parm.get("xzqdm").toString();
            String tbbh = parm.get("tbbh").toString();
            String state = parm.get("state").toString();
            if (("-1").equals(state)) //-1 为撤回 删除 dkxxb
            {
                //年度的无撤回操作
//                try {
//                    //暂时删除 后续备份处理
//                    int k = wpzfInfoTranslateMapper.deleteDkxxb2024(parm);
//                    if (k > -1) {
//                        String jcbh=tbbh;
//                        //更新tbxxb 的填报状态  查询是否有其他地块
//                        if (jcbh.indexOf(",") != -1) {
//                            parm.put("jcbh", jcbh.split("-")[0]);
//                        }
//                        parm.put("jcbh", jcbh.split("-")[0]);
//                        List<WpCjDkxxbxj2023DTO>  list1=wpzfInfoTranslateMapper.queryDkxxbxj(parm);
//                        if(list1!=null && list1.size()==0)
//                        {
//                            //更新tbxxb的状态
//                            int count2= xjtbTbBaseMapper.updateTbxxbXjSaveState1(parm); //iscl 设置为 1
//                            System.out.println("tbxxb状态修改为未填报");
//                        }
//                        k = wpzfInfoTranslateMapper.deletefjinfo(parm);
//                        k = wpzfInfoTranslateMapper.deletepwinfo(parm);
//                        k = wpzfInfoTranslateMapper.deleteshijHcjg(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcJg(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_hf_dtPwwj(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_wf_wfpzwh(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_wf_wftgzmwj(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_qt_qtpzwh(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_qt_qtsftgxxydss(parm);
//                        k = wpzfInfoTranslateMapper.deleteHcjg_qt_qtsfzygd(parm);
//                        return AjaxResult.success(tbbh + "地块已撤回");
//                    } else {
//                        return AjaxResult.error(tbbh + "地块撤回失败");
//                    }
//                }
//                catch (Exception ex)
//                {
//                    return AjaxResult.error(tbbh + "地块撤回失败",ex.toString());
//                }
                return AjaxResult.error(tbbh + "地块撤回失败");
            } else //默认为推送
            {
                String postURL = "";
                String data = "";
                {
                    postURL = "https://jg.landcloud.org.cn:8553/webapi/token";
                    data = "client_id=web&client_secret=e46232c20609435eba54b7576de935dd&grant_type=password&username=a53e0c14ee900728f36bba014d975982&password=b30c775c48e9ba92ade95e427a5242b0";
                }
                URL url = new URL(postURL);
                HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                conn.setRequestMethod("POST");
                conn.setRequestProperty("accept", "*/*");
                conn.setRequestProperty("connection", "Keep-Alive");
                conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");

                conn.setDoOutput(true);
                conn.setDoInput(true);
                OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "utf-8");

                out.write(data);
                //缓冲数据
                out.flush();
                //获取URLConnection对象对应的输入流
                InputStream is = conn.getInputStream();
                int count = 0;
                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                byte[] buffer = new byte[4096];
                while ((count = is.read(buffer)) != -1) {
                    byteArrayOutputStream.write(buffer, 0, count);
                }
                byte[] datas = byteArrayOutputStream.toByteArray();
                byteArrayOutputStream.close();
                //关闭流
                is.close();
                conn.disconnect();
                String result = new String(datas, 0, datas.length, "utf-8");
                //删除到达省级节点得地块
                int k = wpzfInfoTranslateMapper.deletesjDkxxb2024(parm);
                k = wpzfInfoTranslateMapper.deletesjfj2024info(parm);
                k = wpzfInfoTranslateMapper.deletesjpw2024info(parm);
                // 00gty_wpzf_nddk 年度地块
                String str = getNDDxxxbsj(result, "00gty_wpzf_nddk", xzqdm, tbbh); //年度地块信息
                if (str.equals("")) {
                    //入库后 更新tbxxb的状态
                    return AjaxResult.success(tbbh + "地块入库成功");
                } else {
                    return AjaxResult.error(tbbh + "地块入库失败:" + str);
                }

            }
        } catch (Exception ex) {
            return AjaxResult.error("地块入库失败", ex.toString());
        }
    }


    @Transactional
    public String getNDDxxxb(String str, String ywmb, String xzqdm, String tbbh) {
        String rest = "";
        try {
            String postURL = "";
            String token = "";
            String token_type = "";
            Map mapType = JSON.parseObject(str, Map.class);
            {
                for (Object obj : mapType.keySet()) {

                    if ((obj + "").equals("access_token")) {
                        token = mapType.get("access_token") + "";
                        token_type = mapType.get("token_type") + "";
                    }
                }
                System.out.println(token);
                //接口地址
                postURL = "https://dc2.landcloud.org.cn:9443/webapi/api/open/GetWPZFTBInfo";
            }
            URL url = new URL(postURL);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            String encoding = Base64.encode(str.getBytes());
            conn.setRequestProperty("accept", "*/*");
            conn.setRequestProperty("Charset", "utf-8");
            conn.setRequestProperty("connection", "Keep-Alive");
            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
            conn.setRequestProperty("Content-Type", "application/json;charset=utf-8 ");
            conn.setRequestProperty("Authorization", token_type + " " + token);
            //  conn.setRequestProperty("token", token);
            conn.setDoOutput(true);
            conn.setDoInput(true);
            conn.setConnectTimeout(2000);
            conn.setReadTimeout(2000);
            //获取URLConnection对象对应的输出流
            OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "utf-8");
            //  out = new PrintWriter(conn.getOutputStream());
            //发送请求参数即数据
            //String xmbh="210115S120240216LJ00005";

            if (StringUtils.isNotBlank(xzqdm)) {
                //String data = "{\"xzqdm\":\"" + xzqdm + "\",\"ywmb\":\"" + ywmb + "\"}";
                String data = "{\"xzqdm\":\"" + xzqdm + "\",\"ywmb\":\"" + ywmb + "\",\"xmbh\":[\"" + tbbh + "\"]}";
                System.out.println("---------获取地块列表参数------" + data);
                out.write(data);
                out.flush();
                InputStream is = conn.getInputStream();
                int count = 0;
                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                byte[] buffer = new byte[4096];
                while ((count = is.read(buffer)) != -1) {
                    byteArrayOutputStream.write(buffer, 0, count);
                }
                byte[] datas = byteArrayOutputStream.toByteArray();

                byteArrayOutputStream.close();
                is.close();
                conn.disconnect();
                rest = new String(datas, 0, datas.length, "utf-8");
                JSONObject obj = JSONObject.parseObject(rest);
                if (obj.get("data") == null) {
                    rest = data + "获取地块信息为null";
                    return rest;
                }
                String objdata = obj.get("data").toString();
                JSONArray arr = JSONArray.parseArray(objdata);

                List<WpCjDkxxb2024DTO> dkxxb2024DTOList = new ArrayList<WpCjDkxxb2024DTO>();
                List<WpCjFjinfo2024DTO> wpcjFjinfo2024DTO = new ArrayList<WpCjFjinfo2024DTO>();
                List<WpCjPwinfo2024DTO> wpcjPwinfo2024DTO = new ArrayList<WpCjPwinfo2024DTO>();
                if (arr.size() > 0) {
                    for (int i = 0; i < arr.size(); i++) {
                        JSONObject jsonObject = arr.getJSONObject(i);
                        JSONObject wpzfObject = jsonObject.getJSONObject("main").getJSONObject("wpzfdk");
                        JSONArray fjArray = jsonObject.getJSONObject("other").getJSONArray("fjinfo");
                        JSONArray pwArray = jsonObject.getJSONObject("other").getJSONArray("pwinfo");

                        //处理 普通信息
                        WpCjDkxxb2024DTO model = new WpCjDkxxb2024DTO();
                        String nydzypzwh = "";
                        String nydzypwly = "";
                        String nydzypzmj = "";
                        String nydzypzjg = "";
                        String nydzypzrq = "";

                        String nydzytdgypwlxejl = "";
                        String nydzypwlb = "";
                        String nydzypznydmj = "";
                        String nydzypzgdmj = "";
                        String nydzypzyjjbntmj = "";

                        //增减挂钩
                        String zjggpzwh = "";
                        String zjggpwly = "";
                        String zjggpzmj = "";
                        String zjggpzjg = "";
                        String zjggpzrq = "";

                        String zjggtdgypwlxejl = "";
                        String zjggpwlb = "";
                        String zjggpznydmj = "";
                        String zjggpzgdmj = "";
                        String zjggpzyjjbntmj = "";

                        //工矿废弃地
                        String gkfqdpzwh = "";
                        String gkfqdpwly = "";
                        String gkfqdpzmj = "";
                        String gkfqdpzjg = "";
                        String gkfqdpzrq = "";

                        String gkfqdtdgypwlxejl = "";
                        String gkfqdpwlb = "";
                        String gkfqdpznydmj = "";
                        String gkfqdpzgdmj = "";
                        String gkfqdpzyjjbntmj = "";

                        //不动产权证书
                        String bdcqzspzwh = "";
                        String bdcqzspwly = "";
                        String bdcqzspzmj = "";
                        String bdcqzspzjg = "";
                        String bdcqzspzrq = "";

                        String bdcqzstdgypwlxejl = "";
                        String bdcqzspwlb = "";
                        String bdcqzsznydmj = "";
                        String bdcqzspzgdmj = "";
                        String bdcqzspzzyjjbntmj = "";

                        //设施农用地
                        String ssnydpzwh = "";
                        String ssnydpwly = "";
                        String ssnydpzmj = "";
                        String ssnydpzjg = "";
                        String ssnydpzrq = "";


                        String ssnydtdgypwlxejl = "";
                        String ssnydpwlb = "";
                        String ssnydpznydmj = "";
                        String ssnydpzgdmj = "";
                        String ssnydpzyjjbntmj = "";

                        //土地整治验收
                        String tdzzyspzwh = "";
                        String tdzzyspwly = "";
                        String tdzzyspzmj = "";
                        String tdzzyspzjg = "";
                        String tdzzyspzrq = "";

                        String tdzzystdgypwlxejl = "";
                        String tdzzyspwlb = "";
                        String tdzzyspznydmj = "";
                        String tdzzyspzgdmj = "";
                        String tdzzyspzyjjbntmj = "";

                        //其他
                        String qtpzwh = "";
                        String qtpwly = "";
                        String qtpzmj = "";
                        String qtpzjg = "";
                        String qtpzrq = "";

                        String qttdgypwlxejl = "";
                        String qtpwlb = "";
                        String qtpznydmj = "";
                        String qtpzgdmj = "";
                        String qtpzyjjbntmj = "";

                        //临时用地
                        String lsydpzwh = "";
                        String lsydpwly = "";
                        String lsydpzmj = "";
                        String lsydpzjg = "";
                        String lsydpzrq = "";

                        String lsydtdgypwlxejl = "";
                        String lsydpwlb = "";
                        String lsydpznydmj = "";
                        String lsydpzgdmj = "";
                        String lsydpzyjjbntmj = "";

                        //土地供应
                        String tdgypzwh = "";
                        String tdgypwly = "";
                        String tdgypzmj = "";
                        String tdgypzjg = "";
                        String tdgypzrq = "";

                        String tdgytdgypwlxejl = "";
                        String tdgypwlb = "";
                        String tdgypznydmj = "";
                        String tdgypzgdmj = "";
                        String tdgypzyjjbntmj = "";

                        //先行用地
                        String xxydpzwh = "";
                        String xxydpwly = "";
                        String xxydpzmj = "";
                        String xxydpzjg = "";
                        String xxydpzrq = "";

                        String xxydtdgypwlxejl = "";
                        String xxydpwlb = "";
                        String xxydpznydmj = "";
                        String xxydpzgdmj = "";
                        String xxydpzyjjbntmj = "";

                        //预审
                        String yspzwh = "";
                        String yspwly = "";
                        String yspzmj = "";
                        String yspzjg = "";
                        String yspzrq = "";

                        String ystdgypwlxejl = "";
                        String yspwlb = "";
                        String yspznydmj = "";
                        String yspzgdmj = "";
                        String yspzyjjbntmj = "";

                        model.setXzqdm(wpzfObject.get("xzqdm").toString());
                        model.setTbbh(wpzfObject.get("tbbh").toString());

                        if (wpzfObject.get("tbbh").toString().indexOf(",") != -1) {
                            String dkbh1 = wpzfObject.get("tbbh").toString().split(",")[0];
                            model.setJcbh(dkbh1.split("-")[0]);
                        } else {
                            model.setJcbh(wpzfObject.get("tbbh").toString().split("-")[0]);
                        }

                        model.setDkbh(wpzfObject.get("tbbh").toString());

                        model.setWkt(wpzfObject.get("geometry").toString());
                        model.setXfsj(wpzfObject.get("jcrq").toString());
                        //model.setCxbhlx(wpzfObject.get("cxbh").toString()); 持续变化类型
                        model.setTbfl(getValue(wpzfObject.get("tbfl").toString(), "tbfl"));
                        model.setPdlx(getValue(wpzfObject.get("tblx").toString(), "pdlx"));
                        model.setThdkmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("sjtbmj")));
                        model.setThdkgdmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdgdmj")));
                        model.setThdkzjbntmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("yjjbntmj")));
                        model.setThnydmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdnydmj")));
                        model.setThdkstmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("wsx_dlrdstmj")));
                        model.setThstbhhxmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("stbhhxmj")));

                        model.setTbdkmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("sjtbmj")));
                        model.setTbdkqzgdmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdgdmj")));
                        model.setTbdkqzjbntmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("yjjbntmj")));
                        model.setTbnydmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdnydmj")));
                        //填报水田面积 无
                        model.setTbdkstmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("wsx_dlrdstmj")));
                        model.setTbdkstbhhxmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("stbhhxmj")));

                        model.setHfjtqx(getValue(wpzfObject.get("sjyt").toString(), "sjyt"));
                        model.setHfjtlx(getValue(wpzfObject.get("sjyt2").toString(), "sjyt2"));
                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).length() > 2) {
                            model.setHfsjytyj(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString().substring(0, 2));
                            model.setHfsjytyjmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString().substring(0, 2), "hfsjyt"));
                        }
                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).length() > 2) {
                            model.setHfsjytej(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString().substring(0, 2));
                            model.setHfsjytejmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString(), "hfsjyt2j"));
                        }

                        model.setHfpdyjsm(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfpdyjsm")).toString());
                        model.setWflxyj(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx1")).toString());
                        model.setWflxyjmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx1")).toString(), "wflx1"));
                        model.setWflxej(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx2")).toString());
                        model.setWflxejmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx2")).toString(), "wflx2"));
                        model.setWflxsj(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx3")).toString());
                        model.setWflxsjmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx3")).toString(), "wflx3"));
                        model.setWflxsj1(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx4")).toString());
                        model.setWflxsjmc1(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx4")).toString(), "wflx4"));

                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).length() > 2) {
                            model.setWfsjytyj(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString().substring(0, 2));
                            model.setWfsjytyjmc(getValue1(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString(), wpzfObject.get("tblx").toString(), "wfsjyt"));
                        }
                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).length() > 2) {
                            model.setWfsjytej(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString().substring(0, 2));
                            model.setWfsjytejmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString(), "wfsjyt2j"));
                        }

                        model.setWfpdyjsm(wpzfObject.get("wfpdyjsm").toString());
                        model.setClfs(getValue(wpzfObject.get("wf_clfs").toString(), "clfs"));
                        model.setLabh(wpzfObject.get("wf_labh").toString());

                        model.setZglsdwqk(getValue(wpzfObject.get("zglsdwqk").toString(), "zglsdwqk"));
                        model.setHftdymmj(wpzfObject.get("fgymmj").toString());
                        model.setFgdwmj(wpzfObject.get("fgdwmj").toString());

                        model.setCcfgzynmj(wpzfObject.get("ccfg_yjjbnt").toString());
                        model.setCcfgstbhhxmj(wpzfObject.get("ccfg_stbhq").toString());

                        //处罚到位
                        //model.setCcfgstbhhxmj(wpzfObject.get("ccfg_stbhq").toString());
                        model.setZglsqk(model.getZglsdwqk());
                        model.setYjdbm(wpzfObject.get("yjbm").toString());

                        model.setQtjtqx(getValue(wpzfObject.get("qtydsjyt").toString(), "qtydsjyt"));
                        model.setQtjtlx(getValue(wpzfObject.get("qtydsjyt2").toString(), "qtydsjyt2"));

                        model.setQtsjytyj(wpzfObject.get("qtydsjyt").toString());
                        model.setQtsjytyjmc(getValue(wpzfObject.get("qtydsjyt").toString(), "qtydsjyt"));
                        model.setQtpdyjsm(wpzfObject.get("qtpdyjsm").toString());
                        model.setQtsjytej(wpzfObject.get("qtydsjyt2").toString());
                        model.setQtsjytejmc(getValue(wpzfObject.get("qtydsjyt2").toString(), "qtydsjyt2"));
                        //wfxwbh	wfxwsjyt	wfxwsjytmc

                        model.setSfjjxm(getValue(wpzfObject.get("sfjjxm").toString(), "sfjjxm"));

                        model.setSfyfyhfzzdyqxyjsdylws(getValue(wpzfObject.get("sfylwsss").toString(), "sfylwsss"));

                        model.setSfbzxajzf(getValue(wpzfObject.get("sfbzxajzf").toString(), "sfylwsss"));

                        model.setWfxwxmlxmc(getValue(wpzfObject.get("wf_xmlx").toString(), "wf_xmlx"));
                        model.setWfxmmc(wpzfObject.get("wf_xmmc").toString());
                        model.setWfxmzt(wpzfObject.get("wf_xmzt").toString());
                        model.setWflxpzjg(wpzfObject.get("wf_lxpzjg").toString());
                        model.setWflxpzwh(wpzfObject.get("wf_lxpzwh").toString());
                        model.setSfxzlzgdjf(getValue(wpzfObject.get("lzgdjf").toString(), "sfylwsss"));
                        model.setSfwhzj(getValue(wpzfObject.get("sywhzj").toString(), "sfylwsss"));
                        model.setSfdpf(getValue(wpzfObject.get("sfdpf").toString(), "sfylwsss"));
                        model.setYsnydlxxzjsydtb(getValue(wpzfObject.get("sfjsyd").toString(), "sfylwsss"));
                        model.setNdjs(getValue(wpzfObject.get("tbjsqk").toString(), "tbjsqk"));

                        // model.setDkzt("3");
                        model.setIsdel("0");
                        model.setId(random.nextInt());
                        model.setPch("年度卫片（试点）");
                        Map<String, Object> parm = new HashMap<>();
                        parm.put("jcbh", model.getJcbh());
                        parm.put("xzqdm", model.getXzqdm());
                        parm.put("pch", model.getPch());
                        WpCjTbxxb2024DTO wpCjTbxxbxj2023DTO = wpzfTbBaseMapper.querytbxxBytbbh1(parm);
                        if (wpCjTbxxbxj2023DTO != null) {
                            model.setXian(wpCjTbxxbxj2023DTO.qxmc.toString());
                            System.out.println(wpCjTbxxbxj2023DTO.getPch().toString());
                            System.out.println(wpCjTbxxbxj2023DTO.qxmc.toString());
                        }
                        model.setTssj((new Date()).toString());

                        //处理附件信息
                        if (fjArray != null && fjArray.size() > 0) {
                            for (int j = 0; j < fjArray.size(); j++) {
                                JSONObject fjObject = fjArray.getJSONObject(j);
                                WpCjFjinfo2024DTO fjmodel = new WpCjFjinfo2024DTO();
                                fjmodel.setDkbh(model.getTbbh());
                                fjmodel.setPch(model.getPch());
                                fjmodel.setXzqdm(model.getXzqdm());
                                fjmodel.setFjlx(fjObject.get("fjlx").toString());
                                fjmodel.setFjurl(fjObject.get("fjurl").toString());
                                fjmodel.setFjmc(fjObject.get("fjmc").toString());
                                wpcjFjinfo2024DTO.add(fjmodel);
                            }
                        }
                        //处理批文信息
                        if (pwArray != null && pwArray.size() > 0) {
                            for (int j = 0; j < pwArray.size(); j++) {
                                JSONObject pwObject = pwArray.getJSONObject(j);
                                WpCjPwinfo2024DTO pwmodel = new WpCjPwinfo2024DTO();
                                pwmodel.setTbbh(model.getTbbh());
                                pwmodel.setPch(model.getPch());
                                pwmodel.setXzqdm(model.getXzqdm());
                                pwmodel.setPzwhlx(pwObject.get("pzwhlx").toString());
                                pwmodel.setPzwhlxtwo(getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo"));
                                pwmodel.setPzjg(pwObject.get("pzjg").toString());

                                pwmodel.setPwlb(getValue(pwObject.get("pwlb").toString(), "pwlb"));
                                pwmodel.setPzwh(pwObject.get("pzwh").toString());
                                pwmodel.setPzsj(pwObject.get("pzsj").toString());

                                pwmodel.setPwly(getValue(pwObject.get("pwly").toString(), "pwly"));
                                pwmodel.setPzmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pzmj")));

                                pwmodel.setPznydmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pznydmj")));
                                pwmodel.setPzgdmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pzgdmj")));
                                pwmodel.setPzyjjbntmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pzyjjbntmj")));
                                pwmodel.setReason(pwObject.get("reason").toString());
                                wpcjPwinfo2024DTO.add(pwmodel);

                                if (pwObject.get("pzwhlx").toString().equals("NYDZY")) {
                                    nydzypzwh += pwObject.get("pzwh").toString() + ",";
                                    nydzypwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    nydzypzmj += pwObject.get("pzmj").toString() + ",";
                                    nydzypzjg += pwObject.get("pzjg").toString() + ",";
                                    nydzypzrq += pwObject.get("pzsj").toString() + ",";

                                    nydzytdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    nydzypwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    nydzypznydmj += pwObject.get("pznydmj").toString() + ",";
                                    nydzypzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    nydzypzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("ZJGG")) {
                                    zjggpzwh += pwObject.get("pzwh").toString() + ",";
                                    zjggpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    zjggpzmj += pwObject.get("pzmj").toString() + ",";
                                    zjggpzjg += pwObject.get("pzjg").toString() + ",";
                                    zjggpzrq += pwObject.get("pzsj").toString() + ",";

                                    zjggtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    zjggpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    zjggpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    zjggpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    zjggpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("GKFQD")) {
                                    gkfqdpzwh += pwObject.get("pzwh").toString() + ",";
                                    gkfqdpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    gkfqdpzmj += pwObject.get("pzmj").toString() + ",";
                                    gkfqdpzjg += pwObject.get("pzjg").toString() + ",";
                                    gkfqdpzrq += pwObject.get("pzsj").toString() + ",";

                                    gkfqdtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    gkfqdpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    gkfqdpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    gkfqdpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    gkfqdpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("BDCZ")) {

                                    bdcqzspzwh += pwObject.get("pzwh").toString() + ",";
                                    bdcqzspwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    bdcqzspzmj += pwObject.get("pzmj").toString() + ",";
                                    bdcqzspzjg += pwObject.get("pzjg").toString() + ",";
                                    bdcqzspzrq += pwObject.get("pzsj").toString() + ",";

                                    bdcqzstdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    bdcqzspwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    bdcqzsznydmj += pwObject.get("pznydmj").toString() + ",";
                                    bdcqzspzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    bdcqzspzzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("SSNYD")) {
                                    ssnydpzwh += pwObject.get("pzwh").toString() + ",";
                                    ssnydpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    ssnydpzmj += pwObject.get("pzmj").toString() + ",";
                                    ssnydpzjg += pwObject.get("pzjg").toString() + ",";
                                    ssnydpzrq += pwObject.get("pzsj").toString() + ",";

                                    ssnydtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    ssnydpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    ssnydpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    ssnydpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    ssnydpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("TDZZYS")) {
                                    tdzzyspzwh += pwObject.get("pzwh").toString() + ",";
                                    tdzzyspwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    tdzzyspzmj += pwObject.get("pzmj").toString() + ",";
                                    tdzzyspzjg += pwObject.get("pzjg").toString() + ",";
                                    tdzzyspzrq += pwObject.get("pzsj").toString() + ",";

                                    tdzzystdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    tdzzyspwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    tdzzyspznydmj += pwObject.get("pznydmj").toString() + ",";
                                    tdzzyspzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    tdzzyspzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";

                                } else if (pwObject.get("pzwhlx").toString().equals("QT")) {
                                    qtpzwh += pwObject.get("pzwh").toString() + ",";
                                    qtpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    qtpzmj += pwObject.get("pzmj").toString() + ",";
                                    qtpzjg += pwObject.get("pzjg").toString() + ",";
                                    qtpzrq += pwObject.get("pzsj").toString() + ",";

                                    qttdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    qtpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    qtpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    qtpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    qtpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("LSYD")) {
                                    lsydpzwh += pwObject.get("pzwh").toString() + ",";
                                    lsydpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    lsydpzmj += pwObject.get("pzmj").toString() + ",";
                                    lsydpzjg += pwObject.get("pzjg").toString() + ",";
                                    lsydpzrq += pwObject.get("pzsj").toString() + ",";

                                    lsydtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    lsydpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    lsydpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    lsydpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    lsydpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";

                                } else if (pwObject.get("pzwhlx").toString().equals("TDGY")) {
                                    tdgypzwh += pwObject.get("pzwh").toString() + ",";
                                    tdgypwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    tdgypzmj += pwObject.get("pzmj").toString() + ",";
                                    tdgypzjg += pwObject.get("pzjg").toString() + ",";
                                    tdgypzrq += pwObject.get("pzsj").toString() + ",";

                                    tdgytdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    tdgypwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    tdgypznydmj += pwObject.get("pznydmj").toString() + ",";
                                    tdgypzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    tdgypzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("XXYD")) {
                                    //先行用地
                                    xxydpzwh += pwObject.get("pzwh").toString() + ",";
                                    xxydpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    xxydpzmj += pwObject.get("pzmj").toString() + ",";
                                    xxydpzjg += pwObject.get("pzjg").toString() + ",";
                                    xxydpzrq += pwObject.get("pzsj").toString() + ",";

                                    xxydtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    xxydpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    xxydpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    xxydpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    xxydpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("YS")) {
                                    yspzwh += pwObject.get("pzwh").toString() + ",";
                                    yspwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    yspzmj += pwObject.get("pzmj").toString() + ",";
                                    yspzjg += pwObject.get("pzjg").toString() + ",";
                                    yspzrq += pwObject.get("pzsj").toString() + ",";

                                    ystdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    yspwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    yspznydmj += pwObject.get("pznydmj").toString() + ",";
                                    yspzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    yspzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                }
                            }
                        }
                        model.setNydzypzwh(nydzypzwh);
                        model.setNydzypwly(nydzypwly);
                        model.setNydzypzmj(nydzypzmj);
                        model.setNydzypzjg(nydzypzjg);
                        model.setNydzypzrq(nydzypzrq);
                        model.setNydzytdgypwlxejl(nydzytdgypwlxejl);
                        model.setNydzypwlb(nydzypwlb);
                        model.setNydzypznydmj(nydzypznydmj);
                        model.setNydzypzgdmj(nydzypzgdmj);
                        model.setNydzypzyjjbntmj(nydzypzyjjbntmj);

                        model.setZjggpzwh(zjggpzwh);
                        model.setZjggpwly(zjggpwly);
                        model.setZjggpzmj(zjggpzmj);
                        model.setZjggpzjg(zjggpzjg);
                        model.setZjggpzrq(zjggpzrq);
                        model.setZjggtdgypwlxejl(zjggtdgypwlxejl);
                        model.setZjggpwlb(zjggpwlb);
                        model.setZjggpznydmj(zjggpznydmj);
                        model.setZjggpzgdmj(zjggpzgdmj);
                        model.setZjggpzyjjbntmj(zjggpzyjjbntmj);

                        model.setGkfqdpzwh(gkfqdpzwh);
                        model.setGkfqdpwly(gkfqdpwly);
                        model.setGkfqdpzmj(gkfqdpzmj);
                        model.setGkfqdpzjg(gkfqdpzjg);
                        model.setGkfqdpzrq(gkfqdpzrq);
                        model.setGkfqdtdgypwlxejl(gkfqdtdgypwlxejl);
                        model.setGkfqdpwlb(gkfqdpwlb);
                        model.setGkfqdpznydmj(gkfqdpznydmj);
                        model.setGkfqdpzgdmj(gkfqdpzgdmj);
                        model.setGkfqdpzyjjbntmj(gkfqdpzyjjbntmj);

                        model.setBdcqzspzwh(bdcqzspzwh);
                        model.setBdcqzspwly(bdcqzspwly);
                        model.setBdcqzspzmj(bdcqzspzmj);
                        model.setBdcqzspzjg(bdcqzspzjg);
                        model.setBdcqzspzrq(bdcqzspzrq);
                        model.setBdcqzstdgypwlxejl(bdcqzstdgypwlxejl);
                        model.setBdcqzspwlb(bdcqzspwlb);
                        model.setBdcqzspznydmj(bdcqzsznydmj);
                        model.setBdcqzspzgdmj(bdcqzspzgdmj);
                        model.setBdcqzspzzyjjbntmj(bdcqzspzzyjjbntmj);

                        model.setSsnydpzwh(ssnydpzwh);
                        model.setSsnydpwly(ssnydpwly);
                        model.setSsnydpzmj(ssnydpzmj);
                        model.setSsnydpzjg(ssnydpzjg);
                        model.setSsnydpzrq(ssnydpzrq);
                        model.setSsnydtdgypwlxejl(ssnydtdgypwlxejl);
                        model.setSsnydpwlb(ssnydpwlb);
                        model.setSsnydpznydmj(ssnydpznydmj);
                        model.setSsnydpzgdmj(ssnydpzgdmj);
                        model.setSsnydpzyjjbntmj(ssnydpzyjjbntmj);

                        model.setTdzzyspzwh(tdzzyspzwh);
                        model.setTdzzyspwly(tdzzyspwly);
                        model.setTdzzyspzmj(tdzzyspzmj);
                        model.setTdzzyspzjg(tdzzyspzjg);
                        model.setTdzzyspzrq(tdzzyspzrq);
                        model.setTdzzystdgypwlxejl(tdzzystdgypwlxejl);
                        model.setTdzzyspwlb(tdzzyspwlb);
                        model.setTdzzyspznydmj(tdzzyspznydmj);
                        model.setTdzzyspzgdmj(tdzzyspzgdmj);
                        model.setTdzzyspzyjjbntmj(tdzzyspzyjjbntmj);

                        model.setQtpzwh(qtpzwh);
                        model.setQtpwly(qtpwly);
                        model.setQtpzmj(qtpzmj);
                        model.setQtpzjg(qtpzjg);
                        model.setQtpzrq(qtpzrq);
                        model.setQttdgypwlxejl(qttdgypwlxejl);
                        model.setQtpwlb(qtpwlb);
                        model.setQtpznydmj(qtpznydmj);
                        model.setQtpzgdmj(qtpzgdmj);
                        model.setQtpzyjjbntmj(qtpzyjjbntmj);

                        model.setLsydpzwh(lsydpzwh);
                        model.setLsydpwly(lsydpwly);
                        model.setLsydpzmj(lsydpzmj);
                        model.setLsydpzjg(lsydpzjg);
                        model.setLsydpzrq(lsydpzrq);
                        model.setLsydtdgypwlxejl(lsydtdgypwlxejl);
                        model.setLsydpwlb(lsydpwlb);
                        model.setLsydpznydmj(lsydpznydmj);
                        model.setLsydpzgdmj(lsydpzgdmj);
                        model.setLsydpzyjjbntmj(lsydpzyjjbntmj);

                        model.setTdgypzwh(tdgypzwh);
                        model.setTdgypwly(tdgypwly);
                        model.setTdgypzmj(tdgypzmj);
                        model.setTdgypzjg(tdgypzjg);
                        model.setTdgypzrq(tdgypzrq);
                        model.setTdgytdgypwlxejl(tdgytdgypwlxejl);
                        model.setTdgypwlb(tdgypwlb);
                        model.setTdgypznydmj(tdgypznydmj);
                        model.setTdgypzgdmj(tdgypzgdmj);
                        model.setTdgypzyjjbntmj(tdgypzyjjbntmj);

                        model.setXxydpzwh(xxydpzwh);
                        model.setXxydpwly(xxydpwly);
                        model.setXxydpzmj(xxydpzmj);
                        model.setXxydpzjg(xxydpzjg);
                        model.setXxydpzrq(xxydpzrq);
                        model.setXxydtdgypwlxejl(xxydtdgypwlxejl);
                        model.setXxydpwlb(xxydpwlb);
                        model.setXxydpznydmj(xxydpznydmj);
                        model.setXxydpzgdmj(xxydpzgdmj);
                        model.setXxydpzyjjbntmj(xxydpzyjjbntmj);

                        model.setYspzwh(yspzwh);
                        model.setYspwly(yspwly);
                        model.setYspzmj(yspzmj);
                        model.setYspzjg(yspzjg);
                        model.setYspzrq(yspzrq);
                        model.setYstdgypwlxejl(ystdgypwlxejl);
                        model.setYspwlb(yspwlb);
                        model.setYspznydmj(yspznydmj);
                        model.setYspzgdmj(yspzgdmj);
                        model.setYspzyjjbntmj(yspzyjjbntmj);


                        dkxxb2024DTOList.add(model);
                    }
                } else {
                    rest = "获取图斑信息失败";
                    return rest;
                }
                if (dkxxb2024DTOList.size() > 0) {
                    //先删除原有的
                    boolean b = InsertBatchdkxxb(dkxxb2024DTOList);
                    if (b) {
                        System.out.println(xzqdm + "成功导入图斑" + dkxxb2024DTOList.size() + "条");
//                        for(int i=0;i<dkxxb2024DTOList.size();i++)
//                        {
//                            Map<String, Object> parm=new HashMap<>();
//                            parm.put("jcbh",dkxxb2024DTOList.get(i).getJcbh());
//                            parm.put("pch",dkxxb2024DTOList.get(i).getPch());
//                            parm.put("xzqdm",dkxxb2024DTOList.get(i).getXzqdm());
////                            int count1 = xjtbTbBaseMapper.updateTbxxbXjSaveState(parm); //iscl 设置为 1
////                            System.out.println("tbxxb状态修改为已填报");
//                        }

                        b = InsertBatch2nd(wpcjFjinfo2024DTO);
                        if (b) {
                            System.out.println("成功导入附件" + wpcjFjinfo2024DTO.size() + "条");
                            b = InsertBatch3nd(wpcjPwinfo2024DTO);
                            System.out.println("成功导入批文" + wpcjPwinfo2024DTO.size() + "条");
                        }
                        rest = "";
                    } else {
                        rest = "导入失败";
                    }
                }
            }

        } catch (Exception e) {
            rest = "网络异常，请稍后重试！";
            //writeLog(UtilTool.GetTime_1()+"："+e.getMessage()+"\n");
            throw new RuntimeException(e.getMessage());
        }
        return rest;
    }


    @Transactional
    public String getNDDxxxbsj(String str, String ywmb, String xzqdm, String tbbh) {
        String rest = "";
        try {
            String postURL = "";
            String token = "";
            String token_type = "";
            Map mapType = JSON.parseObject(str, Map.class);
            {
                for (Object obj : mapType.keySet()) {

                    if ((obj + "").equals("access_token")) {
                        token = mapType.get("access_token") + "";
                        token_type = mapType.get("token_type") + "";
                    }
                }
                System.out.println(token);
                //接口地址
                postURL = "https://dc2.landcloud.org.cn:9443/webapi/api/open/GetWPZFTBInfo";
            }
            URL url = new URL(postURL);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            String encoding = Base64.encode(str.getBytes());
            conn.setRequestProperty("accept", "*/*");
            conn.setRequestProperty("Charset", "utf-8");
            conn.setRequestProperty("connection", "Keep-Alive");
            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
            conn.setRequestProperty("Content-Type", "application/json;charset=utf-8 ");
            conn.setRequestProperty("Authorization", token_type + " " + token);
            //  conn.setRequestProperty("token", token);
            conn.setDoOutput(true);
            conn.setDoInput(true);
            conn.setConnectTimeout(2000);
            conn.setReadTimeout(2000);
            //获取URLConnection对象对应的输出流
            OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "utf-8");
            //  out = new PrintWriter(conn.getOutputStream());
            //发送请求参数即数据
            //String xmbh="210115S120240216LJ00005";

            if (StringUtils.isNotBlank(xzqdm)) {
                //String data = "{\"xzqdm\":\"" + xzqdm + "\",\"ywmb\":\"" + ywmb + "\"}";
                String data = "{\"xzqdm\":\"" + xzqdm + "\",\"ywmb\":\"" + ywmb + "\",\"xmbh\":[\"" + tbbh + "\"]}";
                System.out.println("---------获取地块列表参数------" + data);
                out.write(data);
                out.flush();
                InputStream is = conn.getInputStream();
                int count = 0;
                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                byte[] buffer = new byte[4096];
                while ((count = is.read(buffer)) != -1) {
                    byteArrayOutputStream.write(buffer, 0, count);
                }
                byte[] datas = byteArrayOutputStream.toByteArray();

                byteArrayOutputStream.close();
                is.close();
                conn.disconnect();
                rest = new String(datas, 0, datas.length, "utf-8");
                JSONObject obj = JSONObject.parseObject(rest);
                if (obj.get("data") == null) {
                    rest = data + "获取地块信息为null";
                    return rest;
                }
                String objdata = obj.get("data").toString();
                JSONArray arr = JSONArray.parseArray(objdata);

                List<WpCjDkxxbsj2024DTO> dkxxbsj2024DTOList = new ArrayList<WpCjDkxxbsj2024DTO>();
                List<WpCjFjinfosj2024DTO> wpcjFjinfosj2024DTO = new ArrayList<WpCjFjinfosj2024DTO>();
                List<WpCjPwinfosj2024DTO> wpcjPwinfosj2024DTO = new ArrayList<WpCjPwinfosj2024DTO>();
                if (arr.size() > 0) {
                    for (int i = 0; i < arr.size(); i++) {
                        JSONObject jsonObject = arr.getJSONObject(i);
                        JSONObject wpzfObject = jsonObject.getJSONObject("main").getJSONObject("wpzfdk");
                        JSONArray fjArray = jsonObject.getJSONObject("other").getJSONArray("fjinfo");
                        JSONArray pwArray = jsonObject.getJSONObject("other").getJSONArray("pwinfo");

                        //处理 普通信息
                        WpCjDkxxbsj2024DTO model = new WpCjDkxxbsj2024DTO();
                        String nydzypzwh = "";
                        String nydzypwly = "";
                        String nydzypzmj = "";
                        String nydzypzjg = "";
                        String nydzypzrq = "";

                        String nydzytdgypwlxejl = "";
                        String nydzypwlb = "";
                        String nydzypznydmj = "";
                        String nydzypzgdmj = "";
                        String nydzypzyjjbntmj = "";

                        //增减挂钩
                        String zjggpzwh = "";
                        String zjggpwly = "";
                        String zjggpzmj = "";
                        String zjggpzjg = "";
                        String zjggpzrq = "";

                        String zjggtdgypwlxejl = "";
                        String zjggpwlb = "";
                        String zjggpznydmj = "";
                        String zjggpzgdmj = "";
                        String zjggpzyjjbntmj = "";

                        //工矿废弃地
                        String gkfqdpzwh = "";
                        String gkfqdpwly = "";
                        String gkfqdpzmj = "";
                        String gkfqdpzjg = "";
                        String gkfqdpzrq = "";

                        String gkfqdtdgypwlxejl = "";
                        String gkfqdpwlb = "";
                        String gkfqdpznydmj = "";
                        String gkfqdpzgdmj = "";
                        String gkfqdpzyjjbntmj = "";

                        //不动产权证书
                        String bdcqzspzwh = "";
                        String bdcqzspwly = "";
                        String bdcqzspzmj = "";
                        String bdcqzspzjg = "";
                        String bdcqzspzrq = "";

                        String bdcqzstdgypwlxejl = "";
                        String bdcqzspwlb = "";
                        String bdcqzsznydmj = "";
                        String bdcqzspzgdmj = "";
                        String bdcqzspzzyjjbntmj = "";

                        //设施农用地
                        String ssnydpzwh = "";
                        String ssnydpwly = "";
                        String ssnydpzmj = "";
                        String ssnydpzjg = "";
                        String ssnydpzrq = "";


                        String ssnydtdgypwlxejl = "";
                        String ssnydpwlb = "";
                        String ssnydpznydmj = "";
                        String ssnydpzgdmj = "";
                        String ssnydpzyjjbntmj = "";

                        //土地整治验收
                        String tdzzyspzwh = "";
                        String tdzzyspwly = "";
                        String tdzzyspzmj = "";
                        String tdzzyspzjg = "";
                        String tdzzyspzrq = "";

                        String tdzzystdgypwlxejl = "";
                        String tdzzyspwlb = "";
                        String tdzzyspznydmj = "";
                        String tdzzyspzgdmj = "";
                        String tdzzyspzyjjbntmj = "";

                        //其他
                        String qtpzwh = "";
                        String qtpwly = "";
                        String qtpzmj = "";
                        String qtpzjg = "";
                        String qtpzrq = "";

                        String qttdgypwlxejl = "";
                        String qtpwlb = "";
                        String qtpznydmj = "";
                        String qtpzgdmj = "";
                        String qtpzyjjbntmj = "";

                        //临时用地
                        String lsydpzwh = "";
                        String lsydpwly = "";
                        String lsydpzmj = "";
                        String lsydpzjg = "";
                        String lsydpzrq = "";

                        String lsydtdgypwlxejl = "";
                        String lsydpwlb = "";
                        String lsydpznydmj = "";
                        String lsydpzgdmj = "";
                        String lsydpzyjjbntmj = "";

                        //土地供应
                        String tdgypzwh = "";
                        String tdgypwly = "";
                        String tdgypzmj = "";
                        String tdgypzjg = "";
                        String tdgypzrq = "";

                        String tdgytdgypwlxejl = "";
                        String tdgypwlb = "";
                        String tdgypznydmj = "";
                        String tdgypzgdmj = "";
                        String tdgypzyjjbntmj = "";

                        //先行用地
                        String xxydpzwh = "";
                        String xxydpwly = "";
                        String xxydpzmj = "";
                        String xxydpzjg = "";
                        String xxydpzrq = "";

                        String xxydtdgypwlxejl = "";
                        String xxydpwlb = "";
                        String xxydpznydmj = "";
                        String xxydpzgdmj = "";
                        String xxydpzyjjbntmj = "";

                        //预审
                        String yspzwh = "";
                        String yspwly = "";
                        String yspzmj = "";
                        String yspzjg = "";
                        String yspzrq = "";

                        String ystdgypwlxejl = "";
                        String yspwlb = "";
                        String yspznydmj = "";
                        String yspzgdmj = "";
                        String yspzyjjbntmj = "";

                        model.setXzqdm(wpzfObject.get("xzqdm").toString());
                        model.setTbbh(wpzfObject.get("tbbh").toString());

                        if (wpzfObject.get("tbbh").toString().indexOf(",") != -1) {
                            String dkbh1 = wpzfObject.get("tbbh").toString().split(",")[0];
                            model.setJcbh(dkbh1.split("-")[0]);
                        } else {
                            model.setJcbh(wpzfObject.get("tbbh").toString().split("-")[0]);
                        }

                        model.setDkbh(wpzfObject.get("tbbh").toString());
                        model.setWkt(wpzfObject.get("geometry").toString());
                        model.setXfsj(wpzfObject.get("jcrq").toString());
                        //model.setCxbhlx(wpzfObject.get("cxbh").toString()); 持续变化类型
                        model.setTbfl(getValue(wpzfObject.get("tbfl").toString(), "tbfl"));
                        model.setPdlx(getValue(wpzfObject.get("tblx").toString(), "pdlx"));
                        model.setThdkmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("sjtbmj")));
                        model.setThdkgdmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdgdmj")));
                        model.setThdkzjbntmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("yjjbntmj")));
                        model.setThnydmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdnydmj")));
                        model.setThdkstmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("wsx_dlrdstmj")));
                        model.setThstbhhxmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("stbhhxmj")));

                        model.setTbdkmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("sjtbmj")));
                        model.setTbdkqzgdmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdgdmj")));
                        model.setTbdkqzjbntmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("yjjbntmj")));
                        model.setTbnydmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdnydmj")));
                        //填报水田面积 无
                        model.setTbdkstmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("wsx_dlrdstmj")));
                        model.setTbdkstbhhxmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("stbhhxmj")));

                        model.setHfjtqx(getValue(wpzfObject.get("sjyt").toString(), "sjyt"));
                        model.setHfjtlx(getValue(wpzfObject.get("sjyt2").toString(), "sjyt2"));
                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).length() > 2) {
                            model.setHfsjytyj(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString().substring(0, 2));
                            model.setHfsjytyjmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString().substring(0, 2), "hfsjyt"));
                        }
                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).length() > 2) {
                            model.setHfsjytej(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString().substring(0, 2));
                            model.setHfsjytejmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString(), "hfsjyt2j"));
                        }

                        model.setHfpdyjsm(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfpdyjsm")).toString());
                        model.setWflxyj(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx1")).toString());
                        model.setWflxyjmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx1")).toString(), "wflx1"));
                        model.setWflxej(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx2")).toString());
                        model.setWflxejmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx2")).toString(), "wflx2"));
                        model.setWflxsj(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx3")).toString());
                        model.setWflxsjmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx3")).toString(), "wflx3"));
                        model.setWflxsj1(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx4")).toString());
                        model.setWflxsjmc1(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx4")).toString(), "wflx4"));

                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).length() > 2) {
                            model.setWfsjytyj(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString().substring(0, 2));
                            model.setWfsjytyjmc(getValue1(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString(), wpzfObject.get("tblx").toString(), "wfsjyt"));
                        }
                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).length() > 2) {
                            model.setWfsjytej(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString().substring(0, 2));
                            model.setWfsjytejmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString(), "wfsjyt2j"));
                        }

                        model.setWfpdyjsm(wpzfObject.get("wfpdyjsm").toString());
                        model.setClfs(getValue(wpzfObject.get("wf_clfs").toString(), "clfs"));
                        model.setLabh(wpzfObject.get("wf_labh").toString());

                        model.setZglsdwqk(getValue(wpzfObject.get("zglsdwqk").toString(), "zglsdwqk"));
                        model.setHftdymmj(wpzfObject.get("fgymmj").toString());
                        model.setFgdwmj(wpzfObject.get("fgdwmj").toString());

                        model.setCcfgzynmj(wpzfObject.get("ccfg_yjjbnt").toString());
                        model.setCcfgstbhhxmj(wpzfObject.get("ccfg_stbhq").toString());

                        //处罚到位
                        //model.setCcfgstbhhxmj(wpzfObject.get("ccfg_stbhq").toString());
                        model.setZglsqk(model.getZglsdwqk());
                        model.setYjdbm(wpzfObject.get("yjbm").toString());

                        model.setQtjtqx(getValue(wpzfObject.get("qtydsjyt").toString(), "qtydsjyt"));
                        model.setQtjtlx(getValue(wpzfObject.get("qtydsjyt2").toString(), "qtydsjyt2"));

                        model.setQtsjytyj(wpzfObject.get("qtydsjyt").toString());
                        model.setQtsjytyjmc(getValue(wpzfObject.get("qtydsjyt").toString(), "qtydsjyt"));
                        model.setQtpdyjsm(wpzfObject.get("qtpdyjsm").toString());
                        model.setQtsjytej(wpzfObject.get("qtydsjyt2").toString());
                        model.setQtsjytejmc(getValue(wpzfObject.get("qtydsjyt2").toString(), "qtydsjyt2"));
                        //wfxwbh	wfxwsjyt	wfxwsjytmc

                        model.setSfjjxm(getValue(wpzfObject.get("sfjjxm").toString(), "sfjjxm"));

                        model.setSfyfyhfzzdyqxyjsdylws(getValue(wpzfObject.get("sfylwsss").toString(), "sfylwsss"));

                        model.setSfbzxajzf(getValue(wpzfObject.get("sfbzxajzf").toString(), "sfylwsss"));

                        model.setWfxwxmlxmc(getValue(wpzfObject.get("wf_xmlx").toString(), "wf_xmlx"));
                        model.setWfxmmc(wpzfObject.get("wf_xmmc").toString());
                        model.setWfxmzt(wpzfObject.get("wf_xmzt").toString());
                        model.setWflxpzjg(wpzfObject.get("wf_lxpzjg").toString());
                        model.setWflxpzwh(wpzfObject.get("wf_lxpzwh").toString());
                        model.setSfxzlzgdjf(getValue(wpzfObject.get("lzgdjf").toString(), "sfylwsss"));
                        model.setSfwhzj(getValue(wpzfObject.get("sywhzj").toString(), "sfylwsss"));
                        model.setSfdpf(getValue(wpzfObject.get("sfdpf").toString(), "sfylwsss"));
                        model.setYsnydlxxzjsydtb(getValue(wpzfObject.get("sfjsyd").toString(), "sfylwsss"));
                        model.setNdjs(getValue(wpzfObject.get("tbjsqk").toString(), "tbjsqk"));

                        model.setDkzt("3");
                        model.setIsdel("0");
                        model.setId(random.nextInt());
                        model.setPch("年度卫片（试点）");
                        Map<String, Object> parm = new HashMap<>();
                        parm.put("jcbh", model.getJcbh());
                        parm.put("xzqdm", model.getXzqdm());
                        parm.put("pch", model.getPch());
                        WpCjTbxxb2024DTO wpCjTbxxbxj2023DTO = wpzfTbBaseMapper.querytbxxBytbbh1(parm);
                        if (wpCjTbxxbxj2023DTO != null) {
                            model.setXian(wpCjTbxxbxj2023DTO.qxmc.toString());
                            System.out.println(wpCjTbxxbxj2023DTO.getPch().toString());
                            System.out.println(wpCjTbxxbxj2023DTO.qxmc.toString());
                        }
                        model.setTssj((new Date()).toString());

                        //处理附件信息
                        if (fjArray != null && fjArray.size() > 0) {
                            for (int j = 0; j < fjArray.size(); j++) {
                                JSONObject fjObject = fjArray.getJSONObject(j);
                                WpCjFjinfosj2024DTO fjmodel = new WpCjFjinfosj2024DTO();
                                fjmodel.setDkbh(model.getTbbh());
                                fjmodel.setPch(model.getPch());
                                fjmodel.setXzqdm(model.getXzqdm());
                                fjmodel.setFjlx(fjObject.get("fjlx").toString());
                                fjmodel.setFjurl(fjObject.get("fjurl").toString());
                                fjmodel.setFjmc(fjObject.get("fjmc").toString());
                                wpcjFjinfosj2024DTO.add(fjmodel);
                            }
                        }
                        //处理批文信息
                        if (pwArray != null && pwArray.size() > 0) {
                            for (int j = 0; j < pwArray.size(); j++) {
                                JSONObject pwObject = pwArray.getJSONObject(j);
                                WpCjPwinfosj2024DTO pwmodel = new WpCjPwinfosj2024DTO();
                                pwmodel.setTbbh(model.getTbbh());
                                pwmodel.setPch(model.getPch());
                                pwmodel.setXzqdm(model.getXzqdm());
                                pwmodel.setPzwhlx(pwObject.get("pzwhlx").toString());
                                pwmodel.setPzwhlxtwo(getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo"));
                                pwmodel.setPzjg(pwObject.get("pzjg").toString());

                                pwmodel.setPwlb(getValue(pwObject.get("pwlb").toString(), "pwlb"));
                                pwmodel.setPzwh(pwObject.get("pzwh").toString());
                                pwmodel.setPzsj(pwObject.get("pzsj").toString());

                                pwmodel.setPwly(getValue(pwObject.get("pwly").toString(), "pwly"));
                                pwmodel.setPzmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pzmj")));

                                pwmodel.setPznydmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pznydmj")));
                                pwmodel.setPzgdmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pzgdmj")));
                                pwmodel.setPzyjjbntmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pzyjjbntmj")));
                                pwmodel.setReason(pwObject.get("reason").toString());
                                wpcjPwinfosj2024DTO.add(pwmodel);

                                if (pwObject.get("pzwhlx").toString().equals("NYDZY")) {
                                    nydzypzwh += pwObject.get("pzwh").toString() + ",";
                                    nydzypwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    nydzypzmj += pwObject.get("pzmj").toString() + ",";
                                    nydzypzjg += pwObject.get("pzjg").toString() + ",";
                                    nydzypzrq += pwObject.get("pzsj").toString() + ",";

                                    nydzytdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    nydzypwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    nydzypznydmj += pwObject.get("pznydmj").toString() + ",";
                                    nydzypzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    nydzypzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("ZJGG")) {
                                    zjggpzwh += pwObject.get("pzwh").toString() + ",";
                                    zjggpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    zjggpzmj += pwObject.get("pzmj").toString() + ",";
                                    zjggpzjg += pwObject.get("pzjg").toString() + ",";
                                    zjggpzrq += pwObject.get("pzsj").toString() + ",";

                                    zjggtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    zjggpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    zjggpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    zjggpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    zjggpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("GKFQD")) {
                                    gkfqdpzwh += pwObject.get("pzwh").toString() + ",";
                                    gkfqdpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    gkfqdpzmj += pwObject.get("pzmj").toString() + ",";
                                    gkfqdpzjg += pwObject.get("pzjg").toString() + ",";
                                    gkfqdpzrq += pwObject.get("pzsj").toString() + ",";

                                    gkfqdtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    gkfqdpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    gkfqdpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    gkfqdpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    gkfqdpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("BDCZ")) {

                                    bdcqzspzwh += pwObject.get("pzwh").toString() + ",";
                                    bdcqzspwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    bdcqzspzmj += pwObject.get("pzmj").toString() + ",";
                                    bdcqzspzjg += pwObject.get("pzjg").toString() + ",";
                                    bdcqzspzrq += pwObject.get("pzsj").toString() + ",";

                                    bdcqzstdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    bdcqzspwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    bdcqzsznydmj += pwObject.get("pznydmj").toString() + ",";
                                    bdcqzspzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    bdcqzspzzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("SSNYD")) {
                                    ssnydpzwh += pwObject.get("pzwh").toString() + ",";
                                    ssnydpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    ssnydpzmj += pwObject.get("pzmj").toString() + ",";
                                    ssnydpzjg += pwObject.get("pzjg").toString() + ",";
                                    ssnydpzrq += pwObject.get("pzsj").toString() + ",";

                                    ssnydtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    ssnydpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    ssnydpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    ssnydpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    ssnydpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("TDZZYS")) {
                                    tdzzyspzwh += pwObject.get("pzwh").toString() + ",";
                                    tdzzyspwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    tdzzyspzmj += pwObject.get("pzmj").toString() + ",";
                                    tdzzyspzjg += pwObject.get("pzjg").toString() + ",";
                                    tdzzyspzrq += pwObject.get("pzsj").toString() + ",";

                                    tdzzystdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    tdzzyspwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    tdzzyspznydmj += pwObject.get("pznydmj").toString() + ",";
                                    tdzzyspzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    tdzzyspzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";

                                } else if (pwObject.get("pzwhlx").toString().equals("QT")) {
                                    qtpzwh += pwObject.get("pzwh").toString() + ",";
                                    qtpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    qtpzmj += pwObject.get("pzmj").toString() + ",";
                                    qtpzjg += pwObject.get("pzjg").toString() + ",";
                                    qtpzrq += pwObject.get("pzsj").toString() + ",";

                                    qttdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    qtpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    qtpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    qtpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    qtpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("LSYD")) {
                                    lsydpzwh += pwObject.get("pzwh").toString() + ",";
                                    lsydpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    lsydpzmj += pwObject.get("pzmj").toString() + ",";
                                    lsydpzjg += pwObject.get("pzjg").toString() + ",";
                                    lsydpzrq += pwObject.get("pzsj").toString() + ",";

                                    lsydtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    lsydpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    lsydpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    lsydpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    lsydpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";

                                } else if (pwObject.get("pzwhlx").toString().equals("TDGY")) {
                                    tdgypzwh += pwObject.get("pzwh").toString() + ",";
                                    tdgypwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    tdgypzmj += pwObject.get("pzmj").toString() + ",";
                                    tdgypzjg += pwObject.get("pzjg").toString() + ",";
                                    tdgypzrq += pwObject.get("pzsj").toString() + ",";

                                    tdgytdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    tdgypwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    tdgypznydmj += pwObject.get("pznydmj").toString() + ",";
                                    tdgypzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    tdgypzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("XXYD")) {
                                    //先行用地
                                    xxydpzwh += pwObject.get("pzwh").toString() + ",";
                                    xxydpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    xxydpzmj += pwObject.get("pzmj").toString() + ",";
                                    xxydpzjg += pwObject.get("pzjg").toString() + ",";
                                    xxydpzrq += pwObject.get("pzsj").toString() + ",";

                                    xxydtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    xxydpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    xxydpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    xxydpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    xxydpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("YS")) {
                                    yspzwh += pwObject.get("pzwh").toString() + ",";
                                    yspwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    yspzmj += pwObject.get("pzmj").toString() + ",";
                                    yspzjg += pwObject.get("pzjg").toString() + ",";
                                    yspzrq += pwObject.get("pzsj").toString() + ",";

                                    ystdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    yspwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    yspznydmj += pwObject.get("pznydmj").toString() + ",";
                                    yspzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    yspzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                }
                            }
                        }
                        model.setNydzypzwh(nydzypzwh);
                        model.setNydzypwly(nydzypwly);
                        model.setNydzypzmj(nydzypzmj);
                        model.setNydzypzjg(nydzypzjg);
                        model.setNydzypzrq(nydzypzrq);
                        model.setNydzytdgypwlxejl(nydzytdgypwlxejl);
                        model.setNydzypwlb(nydzypwlb);
                        model.setNydzypznydmj(nydzypznydmj);
                        model.setNydzypzgdmj(nydzypzgdmj);
                        model.setNydzypzyjjbntmj(nydzypzyjjbntmj);

                        model.setZjggpzwh(zjggpzwh);
                        model.setZjggpwly(zjggpwly);
                        model.setZjggpzmj(zjggpzmj);
                        model.setZjggpzjg(zjggpzjg);
                        model.setZjggpzrq(zjggpzrq);
                        model.setZjggtdgypwlxejl(zjggtdgypwlxejl);
                        model.setZjggpwlb(zjggpwlb);
                        model.setZjggpznydmj(zjggpznydmj);
                        model.setZjggpzgdmj(zjggpzgdmj);
                        model.setZjggpzyjjbntmj(zjggpzyjjbntmj);

                        model.setGkfqdpzwh(gkfqdpzwh);
                        model.setGkfqdpwly(gkfqdpwly);
                        model.setGkfqdpzmj(gkfqdpzmj);
                        model.setGkfqdpzjg(gkfqdpzjg);
                        model.setGkfqdpzrq(gkfqdpzrq);
                        model.setGkfqdtdgypwlxejl(gkfqdtdgypwlxejl);
                        model.setGkfqdpwlb(gkfqdpwlb);
                        model.setGkfqdpznydmj(gkfqdpznydmj);
                        model.setGkfqdpzgdmj(gkfqdpzgdmj);
                        model.setGkfqdpzyjjbntmj(gkfqdpzyjjbntmj);

                        model.setBdcqzspzwh(bdcqzspzwh);
                        model.setBdcqzspwly(bdcqzspwly);
                        model.setBdcqzspzmj(bdcqzspzmj);
                        model.setBdcqzspzjg(bdcqzspzjg);
                        model.setBdcqzspzrq(bdcqzspzrq);
                        model.setBdcqzstdgypwlxejl(bdcqzstdgypwlxejl);
                        model.setBdcqzspwlb(bdcqzspwlb);
                        model.setBdcqzspznydmj(bdcqzsznydmj);
                        model.setBdcqzspzgdmj(bdcqzspzgdmj);
                        model.setBdcqzspzzyjjbntmj(bdcqzspzzyjjbntmj);

                        model.setSsnydpzwh(ssnydpzwh);
                        model.setSsnydpwly(ssnydpwly);
                        model.setSsnydpzmj(ssnydpzmj);
                        model.setSsnydpzjg(ssnydpzjg);
                        model.setSsnydpzrq(ssnydpzrq);
                        model.setSsnydtdgypwlxejl(ssnydtdgypwlxejl);
                        model.setSsnydpwlb(ssnydpwlb);
                        model.setSsnydpznydmj(ssnydpznydmj);
                        model.setSsnydpzgdmj(ssnydpzgdmj);
                        model.setSsnydpzyjjbntmj(ssnydpzyjjbntmj);

                        model.setTdzzyspzwh(tdzzyspzwh);
                        model.setTdzzyspwly(tdzzyspwly);
                        model.setTdzzyspzmj(tdzzyspzmj);
                        model.setTdzzyspzjg(tdzzyspzjg);
                        model.setTdzzyspzrq(tdzzyspzrq);
                        model.setTdzzystdgypwlxejl(tdzzystdgypwlxejl);
                        model.setTdzzyspwlb(tdzzyspwlb);
                        model.setTdzzyspznydmj(tdzzyspznydmj);
                        model.setTdzzyspzgdmj(tdzzyspzgdmj);
                        model.setTdzzyspzyjjbntmj(tdzzyspzyjjbntmj);

                        model.setQtpzwh(qtpzwh);
                        model.setQtpwly(qtpwly);
                        model.setQtpzmj(qtpzmj);
                        model.setQtpzjg(qtpzjg);
                        model.setQtpzrq(qtpzrq);
                        model.setQttdgypwlxejl(qttdgypwlxejl);
                        model.setQtpwlb(qtpwlb);
                        model.setQtpznydmj(qtpznydmj);
                        model.setQtpzgdmj(qtpzgdmj);
                        model.setQtpzyjjbntmj(qtpzyjjbntmj);

                        model.setLsydpzwh(lsydpzwh);
                        model.setLsydpwly(lsydpwly);
                        model.setLsydpzmj(lsydpzmj);
                        model.setLsydpzjg(lsydpzjg);
                        model.setLsydpzrq(lsydpzrq);
                        model.setLsydtdgypwlxejl(lsydtdgypwlxejl);
                        model.setLsydpwlb(lsydpwlb);
                        model.setLsydpznydmj(lsydpznydmj);
                        model.setLsydpzgdmj(lsydpzgdmj);
                        model.setLsydpzyjjbntmj(lsydpzyjjbntmj);

                        model.setTdgypzwh(tdgypzwh);
                        model.setTdgypwly(tdgypwly);
                        model.setTdgypzmj(tdgypzmj);
                        model.setTdgypzjg(tdgypzjg);
                        model.setTdgypzrq(tdgypzrq);
                        model.setTdgytdgypwlxejl(tdgytdgypwlxejl);
                        model.setTdgypwlb(tdgypwlb);
                        model.setTdgypznydmj(tdgypznydmj);
                        model.setTdgypzgdmj(tdgypzgdmj);
                        model.setTdgypzyjjbntmj(tdgypzyjjbntmj);

                        model.setXxydpzwh(xxydpzwh);
                        model.setXxydpwly(xxydpwly);
                        model.setXxydpzmj(xxydpzmj);
                        model.setXxydpzjg(xxydpzjg);
                        model.setXxydpzrq(xxydpzrq);
                        model.setXxydtdgypwlxejl(xxydtdgypwlxejl);
                        model.setXxydpwlb(xxydpwlb);
                        model.setXxydpznydmj(xxydpznydmj);
                        model.setXxydpzgdmj(xxydpzgdmj);
                        model.setXxydpzyjjbntmj(xxydpzyjjbntmj);

                        model.setYspzwh(yspzwh);
                        model.setYspwly(yspwly);
                        model.setYspzmj(yspzmj);
                        model.setYspzjg(yspzjg);
                        model.setYspzrq(yspzrq);
                        model.setYstdgypwlxejl(ystdgypwlxejl);
                        model.setYspwlb(yspwlb);
                        model.setYspznydmj(yspznydmj);
                        model.setYspzgdmj(yspzgdmj);
                        model.setYspzyjjbntmj(yspzyjjbntmj);


                        dkxxbsj2024DTOList.add(model);
                    }
                } else {
                    rest = "获取图斑信息失败";
                    return rest;
                }
                if (dkxxbsj2024DTOList.size() > 0) {
                    //先删除原有的
                    boolean b = InsertBatchdkxxbsj(dkxxbsj2024DTOList);
                    if (b) {
                        System.out.println(xzqdm + "成功导入图斑" + dkxxbsj2024DTOList.size() + "条");
//                        for(int i=0;i<dkxxb2024DTOList.size();i++)
//                        {
//                            Map<String, Object> parm=new HashMap<>();
//                            parm.put("jcbh",dkxxb2024DTOList.get(i).getJcbh());
//                            parm.put("pch",dkxxb2024DTOList.get(i).getPch());
//                            parm.put("xzqdm",dkxxb2024DTOList.get(i).getXzqdm());
////                            int count1 = xjtbTbBaseMapper.updateTbxxbXjSaveState(parm); //iscl 设置为 1
////                            System.out.println("tbxxb状态修改为已填报");
//                        }

                        b = InsertBatch2ndsj(wpcjFjinfosj2024DTO);
                        if (b) {
                            System.out.println("成功导入附件" + wpcjFjinfosj2024DTO.size() + "条");
                            b = InsertBatch3ndsj(wpcjPwinfosj2024DTO);
                            System.out.println("成功导入批文" + wpcjPwinfosj2024DTO.size() + "条");
                        }
                        rest = "";
                    } else {
                        rest = "导入失败";
                    }
                }
            }

        } catch (Exception e) {
            rest = "网络异常，请稍后重试！";
            //writeLog(UtilTool.GetTime_1()+"："+e.getMessage()+"\n");
            throw new RuntimeException(e.getMessage());
        }
        return rest;
    }


    @Transactional
    public String getDxxxb(String str, String ywmb, String xzqdm, String tbbh) {
        String rest = "";
        try {
            String postURL = "";
            String token = "";
            String token_type = "";
            Map mapType = JSON.parseObject(str, Map.class);
            {
                for (Object obj : mapType.keySet()) {

                    if ((obj + "").equals("access_token")) {
                        token = mapType.get("access_token") + "";
                        token_type = mapType.get("token_type") + "";
                    }
                }
                System.out.println(token);
                //接口地址
                postURL = "https://dc2.landcloud.org.cn:9443/webapi/api/open/GetWPZFTBInfo";
            }
            URL url = new URL(postURL);
            System.out.println("postURL:" + postURL);

            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            String encoding = Base64.encode(str.getBytes());
            conn.setRequestProperty("accept", "*/*");
            conn.setRequestProperty("Charset", "utf-8");
            conn.setRequestProperty("connection", "Keep-Alive");
            conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");
            conn.setRequestProperty("Content-Type", "application/json;charset=utf-8 ");
            conn.setRequestProperty("Authorization", token_type + " " + token);
            //  conn.setRequestProperty("token", token);
            conn.setDoOutput(true);
            conn.setDoInput(true);
            conn.setConnectTimeout(2000);
            conn.setReadTimeout(2000);
            //获取URLConnection对象对应的输出流
            OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream(), "utf-8");
            //  out = new PrintWriter(conn.getOutputStream());
            //发送请求参数即数据
            //String xmbh="210115S120240216LJ00005";

            if (StringUtils.isNotBlank(xzqdm)) {
                //String data = "{\"xzqdm\":\"" + xzqdm + "\",\"ywmb\":\"" + ywmb + "\"}";
                String data = "{\"xzqdm\":\"" + xzqdm + "\",\"ywmb\":\"" + ywmb + "\",\"xmbh\":[\"" + tbbh + "\"]}";
                System.out.println("---------获取地块列表参数------" + data);
                out.write(data);
                out.flush();
                InputStream is = conn.getInputStream();
                int count = 0;
                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                byte[] buffer = new byte[4096];
                while ((count = is.read(buffer)) != -1) {
                    byteArrayOutputStream.write(buffer, 0, count);
                }
                byte[] datas = byteArrayOutputStream.toByteArray();

                byteArrayOutputStream.close();
                is.close();
                conn.disconnect();
                rest = new String(datas, 0, datas.length, "utf-8");
                JSONObject obj = JSONObject.parseObject(rest);
                if (obj.get("data") == null) {
                    rest = data + "获取地块信息为null";
                    return rest;
                }
                String objdata = obj.get("data").toString();
                JSONArray arr = JSONArray.parseArray(objdata);

                List<WpCjDkxxbxj2023DTO> dkxxbxj2023DTOList = new ArrayList<WpCjDkxxbxj2023DTO>();
                List<WpCjFjinfo2023DTO> wpcjFjinfo2023DTO = new ArrayList<WpCjFjinfo2023DTO>();
                List<WpCjPwinfo2023DTO> wpcjPwinfo2023DTO = new ArrayList<WpCjPwinfo2023DTO>();
                if (arr.size() > 0) {
                    for (int i = 0; i < arr.size(); i++) {
                        JSONObject jsonObject = arr.getJSONObject(i);
                        JSONObject wpzfObject = jsonObject.getJSONObject("main").getJSONObject("wpzfdk");
                        JSONArray fjArray = jsonObject.getJSONObject("other").getJSONArray("fjinfo");
                        JSONArray pwArray = jsonObject.getJSONObject("other").getJSONArray("pwinfo");

                        //处理 普通信息
                        WpCjDkxxbxj2023DTO model = new WpCjDkxxbxj2023DTO();
                        String nydzypzwh = "";
                        String nydzypwly = "";
                        String nydzypzmj = "";
                        String nydzypzjg = "";
                        String nydzypzrq = "";

                        String nydzytdgypwlxejl = "";
                        String nydzypwlb = "";
                        String nydzypznydmj = "";
                        String nydzypzgdmj = "";
                        String nydzypzyjjbntmj = "";

                        //增减挂钩
                        String zjggpzwh = "";
                        String zjggpwly = "";
                        String zjggpzmj = "";
                        String zjggpzjg = "";
                        String zjggpzrq = "";

                        String zjggtdgypwlxejl = "";
                        String zjggpwlb = "";
                        String zjggpznydmj = "";
                        String zjggpzgdmj = "";
                        String zjggpzyjjbntmj = "";

                        //工矿废弃地
                        String gkfqdpzwh = "";
                        String gkfqdpwly = "";
                        String gkfqdpzmj = "";
                        String gkfqdpzjg = "";
                        String gkfqdpzrq = "";

                        String gkfqdtdgypwlxejl = "";
                        String gkfqdpwlb = "";
                        String gkfqdpznydmj = "";
                        String gkfqdpzgdmj = "";
                        String gkfqdpzyjjbntmj = "";

                        //不动产权证书
                        String bdcqzspzwh = "";
                        String bdcqzspwly = "";
                        String bdcqzspzmj = "";
                        String bdcqzspzjg = "";
                        String bdcqzspzrq = "";

                        String bdcqzstdgypwlxejl = "";
                        String bdcqzspwlb = "";
                        String bdcqzsznydmj = "";
                        String bdcqzspzgdmj = "";
                        String bdcqzspzzyjjbntmj = "";

                        //设施农用地
                        String ssnydpzwh = "";
                        String ssnydpwly = "";
                        String ssnydpzmj = "";
                        String ssnydpzjg = "";
                        String ssnydpzrq = "";


                        String ssnydtdgypwlxejl = "";
                        String ssnydpwlb = "";
                        String ssnydpznydmj = "";
                        String ssnydpzgdmj = "";
                        String ssnydpzyjjbntmj = "";

                        //土地整治验收
                        String tdzzyspzwh = "";
                        String tdzzyspwly = "";
                        String tdzzyspzmj = "";
                        String tdzzyspzjg = "";
                        String tdzzyspzrq = "";

                        String tdzzystdgypwlxejl = "";
                        String tdzzyspwlb = "";
                        String tdzzyspznydmj = "";
                        String tdzzyspzgdmj = "";
                        String tdzzyspzyjjbntmj = "";

                        //其他
                        String qtpzwh = "";
                        String qtpwly = "";
                        String qtpzmj = "";
                        String qtpzjg = "";
                        String qtpzrq = "";

                        String qttdgypwlxejl = "";
                        String qtpwlb = "";
                        String qtpznydmj = "";
                        String qtpzgdmj = "";
                        String qtpzyjjbntmj = "";

                        //临时用地
                        String lsydpzwh = "";
                        String lsydpwly = "";
                        String lsydpzmj = "";
                        String lsydpzjg = "";
                        String lsydpzrq = "";

                        String lsydtdgypwlxejl = "";
                        String lsydpwlb = "";
                        String lsydpznydmj = "";
                        String lsydpzgdmj = "";
                        String lsydpzyjjbntmj = "";

                        //土地供应
                        String tdgypzwh = "";
                        String tdgypwly = "";
                        String tdgypzmj = "";
                        String tdgypzjg = "";
                        String tdgypzrq = "";

                        String tdgytdgypwlxejl = "";
                        String tdgypwlb = "";
                        String tdgypznydmj = "";
                        String tdgypzgdmj = "";
                        String tdgypzyjjbntmj = "";

                        //先行用地
                        String xxydpzwh = "";
                        String xxydpwly = "";
                        String xxydpzmj = "";
                        String xxydpzjg = "";
                        String xxydpzrq = "";

                        String xxydtdgypwlxejl = "";
                        String xxydpwlb = "";
                        String xxydpznydmj = "";
                        String xxydpzgdmj = "";
                        String xxydpzyjjbntmj = "";

                        //预审
                        String yspzwh = "";
                        String yspwly = "";
                        String yspzmj = "";
                        String yspzjg = "";
                        String yspzrq = "";

                        String ystdgypwlxejl = "";
                        String yspwlb = "";
                        String yspznydmj = "";
                        String yspzgdmj = "";
                        String yspzyjjbntmj = "";

                        model.setXzqdm(wpzfObject.get("xzqdm").toString());
                        model.setTbbh(wpzfObject.get("tbbh").toString());

                        if (wpzfObject.get("tbbh").toString().indexOf(",") != -1) {
                            String dkbh1 = wpzfObject.get("tbbh").toString().split(",")[0];
                            model.setJcbh(dkbh1.split("-")[0]);
                        } else {
                            model.setJcbh(wpzfObject.get("tbbh").toString().split("-")[0]);
                        }

                        model.setDkbh(wpzfObject.get("tbbh").toString());
                        model.setWkt(wpzfObject.get("geometry").toString());
                        model.setXfsj(wpzfObject.get("jcrq").toString());
                        //model.setCxbhlx(wpzfObject.get("cxbh").toString()); 持续变化类型
                        model.setTbfl(getValue(wpzfObject.get("tbfl").toString(), "tbfl"));
                        model.setPdlx(getValue(wpzfObject.get("tblx").toString(), "pdlx"));
                        model.setThdkmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("sjtbmj")));
                        model.setThdkgdmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdgdmj")));
                        model.setThdkzjbntmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("yjjbntmj")));
                        model.setThnydmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdnydmj")));
                        model.setThdkstmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("wsx_dlrdstmj")));
                        model.setThstbhhxmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("stbhhxmj")));

                        model.setTbdkmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("sjtbmj")));
                        model.setTbdkqzgdmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdgdmj")));
                        model.setTbdkqzjbntmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("yjjbntmj")));
                        model.setTbnydmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("dlrdnydmj")));
                        //填报水田面积 无
                        model.setTbdkstmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("wsx_dlrdstmj")));
                        model.setTbdkstbhhxmj(MyObjectUtil.objectIsNullToDouble(wpzfObject.get("stbhhxmj")));

                        model.setHfjtqx(getValue(wpzfObject.get("sjyt").toString(), "sjyt"));
                        model.setHfjtlx(getValue(wpzfObject.get("sjyt2").toString(), "sjyt2"));
                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).length() > 2) {
                            model.setHfsjytyj(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString().substring(0, 2));
                            model.setHfsjytyjmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString().substring(0, 2), "hfsjyt"));
                        }
                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).length() > 2) {
                            model.setHfsjytej(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString().substring(0, 2));
                            model.setHfsjytejmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfsjyt")).toString(), "hfsjyt2j"));
                        }

                        model.setHfpdyjsm(MyObjectUtil.objectIsNullToString(wpzfObject.get("hfpdyjsm")).toString());
                        model.setWflxyj(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx1")).toString());
                        model.setWflxyjmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx1")).toString(), "wflx1"));
                        model.setWflxej(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx2")).toString());
                        model.setWflxejmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx2")).toString(), "wflx2"));
                        model.setWflxsj(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx3")).toString());
                        model.setWflxsjmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx3")).toString(), "wflx3"));
                        model.setWflxsj1(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx4")).toString());
                        model.setWflxsjmc1(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wflx4")).toString(), "wflx4"));

                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).length() > 2) {
                            model.setWfsjytyj(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString().substring(0, 2));
                            model.setWfsjytyjmc(getValue1(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString(), wpzfObject.get("tblx").toString(), "wfsjyt"));
                        }
                        if (MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).length() > 2) {
                            model.setWfsjytej(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString().substring(0, 2));
                            model.setWfsjytejmc(getValue(MyObjectUtil.objectIsNullToString(wpzfObject.get("wfsjyt")).toString(), "wfsjyt2j"));
                        }

                        model.setWfpdyjsm(wpzfObject.get("wfpdyjsm").toString());
                        model.setClfs(getValue(wpzfObject.get("wf_clfs").toString(), "clfs"));
                        model.setLabh(wpzfObject.get("wf_labh").toString());

                        model.setZglsdwqk(getValue(wpzfObject.get("zglsdwqk").toString(), "zglsdwqk"));
                        model.setHftdymmj(wpzfObject.get("fgymmj").toString());
                        model.setFgdwmj(wpzfObject.get("fgdwmj").toString());

                        model.setCcfgzynmj(wpzfObject.get("ccfg_yjjbnt").toString());
                        model.setCcfgstbhhxmj(wpzfObject.get("ccfg_stbhq").toString());

                        //处罚到位
                        //model.setCcfgstbhhxmj(wpzfObject.get("ccfg_stbhq").toString());
                        model.setZglsqk(model.getZglsdwqk());
                        model.setYjdbm(wpzfObject.get("yjbm").toString());

                        model.setQtjtqx(getValue(wpzfObject.get("qtydsjyt").toString(), "qtydsjyt"));
                        model.setQtjtlx(getValue(wpzfObject.get("qtydsjyt2").toString(), "qtydsjyt2"));

                        model.setQtsjytyj(wpzfObject.get("qtydsjyt").toString());
                        model.setQtsjytyjmc(getValue(wpzfObject.get("qtydsjyt").toString(), "qtydsjyt"));
                        model.setQtpdyjsm(wpzfObject.get("qtpdyjsm").toString());
                        model.setQtsjytej(wpzfObject.get("qtydsjyt2").toString());
                        model.setQtsjytejmc(getValue(wpzfObject.get("qtydsjyt2").toString(), "qtydsjyt2"));
                        //wfxwbh	wfxwsjyt	wfxwsjytmc

                        model.setSfjjxm(getValue(wpzfObject.get("sfjjxm").toString(), "sfjjxm"));

                        model.setSfyfyhfzzdyqxyjsdylws(getValue(wpzfObject.get("sfylwsss").toString(), "sfylwsss"));

                        model.setSfbzxajzf(getValue(wpzfObject.get("sfbzxajzf").toString(), "sfylwsss"));

                        model.setWfxwxmlxmc(getValue(wpzfObject.get("wf_xmlx").toString(), "wf_xmlx"));
                        model.setWfxmmc(wpzfObject.get("wf_xmmc").toString());
                        model.setWfxmzt(wpzfObject.get("wf_xmzt").toString());
                        model.setWflxpzjg(wpzfObject.get("wf_lxpzjg").toString());
                        model.setWflxpzwh(wpzfObject.get("wf_lxpzwh").toString());
                        model.setSfxzlzgdjf(getValue(wpzfObject.get("lzgdjf").toString(), "sfylwsss"));
                        model.setSfwhzj(getValue(wpzfObject.get("sywhzj").toString(), "sfylwsss"));
                        model.setSfdpf(getValue(wpzfObject.get("sfdpf").toString(), "sfylwsss"));
                        model.setYsnydlxxzjsydtb(getValue(wpzfObject.get("sfjsyd").toString(), "sfylwsss"));
                        model.setNdjs(getValue(wpzfObject.get("tbjsqk").toString(), "tbjsqk"));

                        model.setDkzt("3");
                        model.setIsdel("0");
                        Map<String, Object> parm = new HashMap<>();
                        parm.put("jcbh", model.getJcbh());
                        parm.put("xzqdm", model.getXzqdm());
                        WpCjTbxxbxj2023DTO wpCjTbxxbxj2023DTO = xjtbTbBaseMapper.querytbxxByjcbhxzqh(parm);
                        if (wpCjTbxxbxj2023DTO != null) {
                            model.setPch(wpCjTbxxbxj2023DTO.getPch());
                        }
                        model.setTssj((new Date()).toString());

                        //处理附件信息
                        if (fjArray != null && fjArray.size() > 0) {
                            for (int j = 0; j < fjArray.size(); j++) {
                                JSONObject fjObject = fjArray.getJSONObject(j);
                                WpCjFjinfo2023DTO fjmodel = new WpCjFjinfo2023DTO();
                                fjmodel.setDkbh(model.getTbbh());
                                fjmodel.setPch(model.getPch());
                                fjmodel.setXzqdm(model.getXzqdm());
                                fjmodel.setFjlx(fjObject.get("fjlx").toString());
                                fjmodel.setFjurl(fjObject.get("fjurl").toString());
                                fjmodel.setFjmc(fjObject.get("fjmc").toString());
                                wpcjFjinfo2023DTO.add(fjmodel);
                            }
                        }
                        //处理批文信息
                        if (pwArray != null && pwArray.size() > 0) {
                            for (int j = 0; j < pwArray.size(); j++) {
                                JSONObject pwObject = pwArray.getJSONObject(j);
                                WpCjPwinfo2023DTO pwmodel = new WpCjPwinfo2023DTO();
                                pwmodel.setTbbh(model.getTbbh());
                                pwmodel.setPch(model.getPch());
                                pwmodel.setXzqdm(model.getXzqdm());
                                pwmodel.setPzwhlx(pwObject.get("pzwhlx").toString());
                                pwmodel.setPzwhlxtwo(getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo"));
                                pwmodel.setPzjg(pwObject.get("pzjg").toString());

                                pwmodel.setPwlb(getValue(pwObject.get("pwlb").toString(), "pwlb"));
                                pwmodel.setPzwh(pwObject.get("pzwh").toString());
                                pwmodel.setPzsj(pwObject.get("pzsj").toString());

                                pwmodel.setPwly(getValue(pwObject.get("pwly").toString(), "pwly"));
                                pwmodel.setPzmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pzmj")));

                                pwmodel.setPznydmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pznydmj")));
                                pwmodel.setPzgdmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pzgdmj")));
                                pwmodel.setPzyjjbntmj(MyObjectUtil.objectIsNullToDouble(pwObject.get("pzyjjbntmj")));
                                pwmodel.setReason(pwObject.get("reason").toString());
                                wpcjPwinfo2023DTO.add(pwmodel);

                                if (pwObject.get("pzwhlx").toString().equals("NYDZY")) {
                                    nydzypzwh += pwObject.get("pzwh").toString() + ",";
                                    nydzypwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    nydzypzmj += pwObject.get("pzmj").toString() + ",";
                                    nydzypzjg += pwObject.get("pzjg").toString() + ",";
                                    nydzypzrq += pwObject.get("pzsj").toString() + ",";

                                    nydzytdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    nydzypwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    nydzypznydmj += pwObject.get("pznydmj").toString() + ",";
                                    nydzypzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    nydzypzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("ZJGG")) {
                                    zjggpzwh += pwObject.get("pzwh").toString() + ",";
                                    zjggpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    zjggpzmj += pwObject.get("pzmj").toString() + ",";
                                    zjggpzjg += pwObject.get("pzjg").toString() + ",";
                                    zjggpzrq += pwObject.get("pzsj").toString() + ",";

                                    zjggtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    zjggpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    zjggpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    zjggpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    zjggpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("GKFQD")) {
                                    gkfqdpzwh += pwObject.get("pzwh").toString() + ",";
                                    gkfqdpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    gkfqdpzmj += pwObject.get("pzmj").toString() + ",";
                                    gkfqdpzjg += pwObject.get("pzjg").toString() + ",";
                                    gkfqdpzrq += pwObject.get("pzsj").toString() + ",";

                                    gkfqdtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    gkfqdpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    gkfqdpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    gkfqdpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    gkfqdpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("BDCZ")) {

                                    bdcqzspzwh += pwObject.get("pzwh").toString() + ",";
                                    bdcqzspwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    bdcqzspzmj += pwObject.get("pzmj").toString() + ",";
                                    bdcqzspzjg += pwObject.get("pzjg").toString() + ",";
                                    bdcqzspzrq += pwObject.get("pzsj").toString() + ",";

                                    bdcqzstdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    bdcqzspwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    bdcqzsznydmj += pwObject.get("pznydmj").toString() + ",";
                                    bdcqzspzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    bdcqzspzzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("SSNYD")) {
                                    ssnydpzwh += pwObject.get("pzwh").toString() + ",";
                                    ssnydpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    ssnydpzmj += pwObject.get("pzmj").toString() + ",";
                                    ssnydpzjg += pwObject.get("pzjg").toString() + ",";
                                    ssnydpzrq += pwObject.get("pzsj").toString() + ",";

                                    ssnydtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    ssnydpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    ssnydpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    ssnydpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    ssnydpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("TDZZYS")) {
                                    tdzzyspzwh += pwObject.get("pzwh").toString() + ",";
                                    tdzzyspwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    tdzzyspzmj += pwObject.get("pzmj").toString() + ",";
                                    tdzzyspzjg += pwObject.get("pzjg").toString() + ",";
                                    tdzzyspzrq += pwObject.get("pzsj").toString() + ",";

                                    tdzzystdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    tdzzyspwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    tdzzyspznydmj += pwObject.get("pznydmj").toString() + ",";
                                    tdzzyspzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    tdzzyspzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";

                                } else if (pwObject.get("pzwhlx").toString().equals("QT")) {
                                    qtpzwh += pwObject.get("pzwh").toString() + ",";
                                    qtpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    qtpzmj += pwObject.get("pzmj").toString() + ",";
                                    qtpzjg += pwObject.get("pzjg").toString() + ",";
                                    qtpzrq += pwObject.get("pzsj").toString() + ",";

                                    qttdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    qtpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    qtpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    qtpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    qtpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("LSYD")) {
                                    lsydpzwh += pwObject.get("pzwh").toString() + ",";
                                    lsydpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    lsydpzmj += pwObject.get("pzmj").toString() + ",";
                                    lsydpzjg += pwObject.get("pzjg").toString() + ",";
                                    lsydpzrq += pwObject.get("pzsj").toString() + ",";

                                    lsydtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    lsydpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    lsydpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    lsydpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    lsydpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";

                                } else if (pwObject.get("pzwhlx").toString().equals("TDGY")) {
                                    tdgypzwh += pwObject.get("pzwh").toString() + ",";
                                    tdgypwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    tdgypzmj += pwObject.get("pzmj").toString() + ",";
                                    tdgypzjg += pwObject.get("pzjg").toString() + ",";
                                    tdgypzrq += pwObject.get("pzsj").toString() + ",";

                                    tdgytdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    tdgypwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    tdgypznydmj += pwObject.get("pznydmj").toString() + ",";
                                    tdgypzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    tdgypzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("XXYD")) {
                                    //先行用地
                                    xxydpzwh += pwObject.get("pzwh").toString() + ",";
                                    xxydpwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    xxydpzmj += pwObject.get("pzmj").toString() + ",";
                                    xxydpzjg += pwObject.get("pzjg").toString() + ",";
                                    xxydpzrq += pwObject.get("pzsj").toString() + ",";

                                    xxydtdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    xxydpwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    xxydpznydmj += pwObject.get("pznydmj").toString() + ",";
                                    xxydpzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    xxydpzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                } else if (pwObject.get("pzwhlx").toString().equals("YS")) {
                                    yspzwh += pwObject.get("pzwh").toString() + ",";
                                    yspwly += getValue(pwObject.get("pwly").toString(), "pwly") + ",";
                                    yspzmj += pwObject.get("pzmj").toString() + ",";
                                    yspzjg += pwObject.get("pzjg").toString() + ",";
                                    yspzrq += pwObject.get("pzsj").toString() + ",";

                                    ystdgypwlxejl += getValue(pwObject.get("pzwhlxtwo").toString(), "pzwhlxtwo") + ",";
                                    yspwlb += getValue(pwObject.get("pwlb").toString(), "pwlb") + ",";
                                    yspznydmj += pwObject.get("pznydmj").toString() + ",";
                                    yspzgdmj += pwObject.get("pzgdmj").toString() + ",";
                                    yspzyjjbntmj += pwObject.get("pzyjjbntmj").toString() + ",";
                                }
                            }
                        }
                        model.setNydzypzwh(nydzypzwh);
                        model.setNydzypwly(nydzypwly);
                        model.setNydzypzmj(nydzypzmj);
                        model.setNydzypzjg(nydzypzjg);
                        model.setNydzypzrq(nydzypzrq);
                        model.setNydzytdgypwlxejl(nydzytdgypwlxejl);
                        model.setNydzypwlb(nydzypwlb);
                        model.setNydzypznydmj(nydzypznydmj);
                        model.setNydzypzgdmj(nydzypzgdmj);
                        model.setNydzypzyjjbntmj(nydzypzyjjbntmj);

                        model.setZjggpzwh(zjggpzwh);
                        model.setZjggpwly(zjggpwly);
                        model.setZjggpzmj(zjggpzmj);
                        model.setZjggpzjg(zjggpzjg);
                        model.setZjggpzrq(zjggpzrq);
                        model.setZjggtdgypwlxejl(zjggtdgypwlxejl);
                        model.setZjggpwlb(zjggpwlb);
                        model.setZjggpznydmj(zjggpznydmj);
                        model.setZjggpzgdmj(zjggpzgdmj);
                        model.setZjggpzyjjbntmj(zjggpzyjjbntmj);

                        model.setGkfqdpzwh(gkfqdpzwh);
                        model.setGkfqdpwly(gkfqdpwly);
                        model.setGkfqdpzmj(gkfqdpzmj);
                        model.setGkfqdpzjg(gkfqdpzjg);
                        model.setGkfqdpzrq(gkfqdpzrq);
                        model.setGkfqdtdgypwlxejl(gkfqdtdgypwlxejl);
                        model.setGkfqdpwlb(gkfqdpwlb);
                        model.setGkfqdpznydmj(gkfqdpznydmj);
                        model.setGkfqdpzgdmj(gkfqdpzgdmj);
                        model.setGkfqdpzyjjbntmj(gkfqdpzyjjbntmj);

                        model.setBdcqzspzwh(bdcqzspzwh);
                        model.setBdcqzspwly(bdcqzspwly);
                        model.setBdcqzspzmj(bdcqzspzmj);
                        model.setBdcqzspzjg(bdcqzspzjg);
                        model.setBdcqzspzrq(bdcqzspzrq);
                        model.setBdcqzstdgypwlxejl(bdcqzstdgypwlxejl);
                        model.setBdcqzspwlb(bdcqzspwlb);
                        model.setBdcqzspznydmj(bdcqzsznydmj);
                        model.setBdcqzspzgdmj(bdcqzspzgdmj);
                        model.setBdcqzspzzyjjbntmj(bdcqzspzzyjjbntmj);

                        model.setSsnydpzwh(ssnydpzwh);
                        model.setSsnydpwly(ssnydpwly);
                        model.setSsnydpzmj(ssnydpzmj);
                        model.setSsnydpzjg(ssnydpzjg);
                        model.setSsnydpzrq(ssnydpzrq);
                        model.setSsnydtdgypwlxejl(ssnydtdgypwlxejl);
                        model.setSsnydpwlb(ssnydpwlb);
                        model.setSsnydpznydmj(ssnydpznydmj);
                        model.setSsnydpzgdmj(ssnydpzgdmj);
                        model.setSsnydpzyjjbntmj(ssnydpzyjjbntmj);

                        model.setTdzzyspzwh(tdzzyspzwh);
                        model.setTdzzyspwly(tdzzyspwly);
                        model.setTdzzyspzmj(tdzzyspzmj);
                        model.setTdzzyspzjg(tdzzyspzjg);
                        model.setTdzzyspzrq(tdzzyspzrq);
                        model.setTdzzystdgypwlxejl(tdzzystdgypwlxejl);
                        model.setTdzzyspwlb(tdzzyspwlb);
                        model.setTdzzyspznydmj(tdzzyspznydmj);
                        model.setTdzzyspzgdmj(tdzzyspzgdmj);
                        model.setTdzzyspzyjjbntmj(tdzzyspzyjjbntmj);

                        model.setQtpzwh(qtpzwh);
                        model.setQtpwly(qtpwly);
                        model.setQtpzmj(qtpzmj);
                        model.setQtpzjg(qtpzjg);
                        model.setQtpzrq(qtpzrq);
                        model.setQttdgypwlxejl(qttdgypwlxejl);
                        model.setQtpwlb(qtpwlb);
                        model.setQtpznydmj(qtpznydmj);
                        model.setQtpzgdmj(qtpzgdmj);
                        model.setQtpzyjjbntmj(qtpzyjjbntmj);

                        model.setLsydpzwh(lsydpzwh);
                        model.setLsydpwly(lsydpwly);
                        model.setLsydpzmj(lsydpzmj);
                        model.setLsydpzjg(lsydpzjg);
                        model.setLsydpzrq(lsydpzrq);
                        model.setLsydtdgypwlxejl(lsydtdgypwlxejl);
                        model.setLsydpwlb(lsydpwlb);
                        model.setLsydpznydmj(lsydpznydmj);
                        model.setLsydpzgdmj(lsydpzgdmj);
                        model.setLsydpzyjjbntmj(lsydpzyjjbntmj);

                        model.setTdgypzwh(tdgypzwh);
                        model.setTdgypwly(tdgypwly);
                        model.setTdgypzmj(tdgypzmj);
                        model.setTdgypzjg(tdgypzjg);
                        model.setTdgypzrq(tdgypzrq);
                        model.setTdgytdgypwlxejl(tdgytdgypwlxejl);
                        model.setTdgypwlb(tdgypwlb);
                        model.setTdgypznydmj(tdgypznydmj);
                        model.setTdgypzgdmj(tdgypzgdmj);
                        model.setTdgypzyjjbntmj(tdgypzyjjbntmj);

                        model.setXxydpzwh(xxydpzwh);
                        model.setXxydpwly(xxydpwly);
                        model.setXxydpzmj(xxydpzmj);
                        model.setXxydpzjg(xxydpzjg);
                        model.setXxydpzrq(xxydpzrq);
                        model.setXxydtdgypwlxejl(xxydtdgypwlxejl);
                        model.setXxydpwlb(xxydpwlb);
                        model.setXxydpznydmj(xxydpznydmj);
                        model.setXxydpzgdmj(xxydpzgdmj);
                        model.setXxydpzyjjbntmj(xxydpzyjjbntmj);

                        model.setYspzwh(yspzwh);
                        model.setYspwly(yspwly);
                        model.setYspzmj(yspzmj);
                        model.setYspzjg(yspzjg);
                        model.setYspzrq(yspzrq);
                        model.setYstdgypwlxejl(ystdgypwlxejl);
                        model.setYspwlb(yspwlb);
                        model.setYspznydmj(yspznydmj);
                        model.setYspzgdmj(yspzgdmj);
                        model.setYspzyjjbntmj(yspzyjjbntmj);


                        dkxxbxj2023DTOList.add(model);
                    }
                } else {
                    rest = "获取图斑信息失败";
                    return rest;
                }
                if (dkxxbxj2023DTOList.size() > 0) {
                    //先删除原有的
                    boolean b = InsertBatch1(dkxxbxj2023DTOList);
                    if (b) {
                        System.out.println(xzqdm + "成功导入图斑" + dkxxbxj2023DTOList.size() + "条");
                        for (int i = 0; i < dkxxbxj2023DTOList.size(); i++) {
                            Map<String, Object> parm = new HashMap<>();
                            parm.put("jcbh", dkxxbxj2023DTOList.get(i).getJcbh());
                            parm.put("pch", dkxxbxj2023DTOList.get(i).getPch());
                            parm.put("xzqdm", dkxxbxj2023DTOList.get(i).getXzqdm());
                            int count1 = xjtbTbBaseMapper.updateTbxxbXjSaveState(parm); //iscl 设置为 1
                            System.out.println("tbxxb状态修改为已填报");
                        }

                        b = InsertBatch2(wpcjFjinfo2023DTO);
                        if (b) {
                            System.out.println("成功导入附件" + wpcjFjinfo2023DTO.size() + "条");
                            b = InsertBatch3(wpcjPwinfo2023DTO);
                            System.out.println("成功导入批文" + wpcjPwinfo2023DTO.size() + "条");
                        }
                        rest = "";
                    } else {
                        rest = "导入失败";
                    }
                }
            }

        } catch (Exception e) {
            rest = "网络异常，请稍后重试！";
            //writeLog(UtilTool.GetTime_1()+"："+e.getMessage()+"\n");
            throw new RuntimeException(e.getMessage());
        }
        return rest;
    }

    public static String downloadByIO(String url, String saveDir, String fileName) {
        BufferedOutputStream bos = null;
        InputStream is = null;
        try {
            byte[] buff = new byte[8192];
            is = new URL(url).openStream();
            File file = new File(saveDir, fileName);
            file.getParentFile().mkdirs();
            bos = new BufferedOutputStream(new FileOutputStream(file));
            int count = 0;
            while ((count = is.read(buff)) != -1) {
                bos.write(buff, 0, count);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            if (bos != null) {
                try {
                    bos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return saveDir + "\\" + fileName;
    }


    @Transactional
    public boolean InsertBatch(List<WpCjTbxxbxj2023DTO> tbxxbxj2023DTOList) {
        SqlSession sqlSession = null;
        try {
            //使用批处理
            sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
            WpCjTbxxbxj2023DTOMapper tbxxbMapper = sqlSession.getMapper(WpCjTbxxbxj2023DTOMapper.class);
            tbxxbxj2023DTOList.stream().forEach(tbxxbDao -> tbxxbMapper.insert(tbxxbDao));
            sqlSession.commit();
            return true;
        } catch (Exception ex) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            ex.printStackTrace();
            return false;
        } finally {
            // 确保SqlSession被关闭
            if (sqlSession != null) {
                sqlSession.close();
            }
        }
    }

    @Transactional
    public boolean InsertBatchtbxxb(List<WpCjTbxxb2024DTO> tbxxbDTOList) {
        SqlSession sqlSession = null;
        try {
            //使用批处理
            sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
            WpCjTbxxb2024DTOMapper tbxxbMapper = sqlSession.getMapper(WpCjTbxxb2024DTOMapper.class);
            tbxxbDTOList.stream().forEach(tbxxbDao -> tbxxbMapper.insert(tbxxbDao));
            sqlSession.commit();
            return true;
        } catch (Exception ex) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            ex.printStackTrace();
            return false;
        } finally {
            // 确保SqlSession被关闭
            if (sqlSession != null) {
                sqlSession.close();
            }
        }
    }

    @Transactional
    public boolean InsertBatchdkxxbsj(List<WpCjDkxxbsj2024DTO> dkxxb2024DTOList) {
        SqlSession sqlSession = null;
        try {
            //使用批处理
            sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
            WpCjDkxxbsj2024DTOMapper dkxxbMapper = sqlSession.getMapper(WpCjDkxxbsj2024DTOMapper.class);
            dkxxb2024DTOList.stream().forEach(dkxxbDao -> dkxxbMapper.insert(dkxxbDao));
            sqlSession.commit();
            return true;
        } catch (Exception ex) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            ex.printStackTrace();
            return false;
        } finally {
            // 确保SqlSession被关闭
            if (sqlSession != null) {
                sqlSession.close();
            }
        }
    }

    @Transactional
    public boolean InsertBatch2ndsj(List<WpCjFjinfosj2024DTO> wpcjFjinfo2024DTO) {
        SqlSession sqlSession = null;
        try {
            //使用批处理
            sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
            WpCjFjinfosj2024DTOMapper wpzffjinfoMapper = sqlSession.getMapper(WpCjFjinfosj2024DTOMapper.class);
            wpcjFjinfo2024DTO.stream().forEach(fjinfo2024DTO -> wpzffjinfoMapper.insert(fjinfo2024DTO));
            sqlSession.commit();
            return true;
        } catch (Exception ex) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            ex.printStackTrace();
            return false;
        } finally {
            // 确保SqlSession被关闭
            if (sqlSession != null) {
                sqlSession.close();
            }
        }
    }

    @Transactional
    public boolean InsertBatch3ndsj(List<WpCjPwinfosj2024DTO> wpcjPjinfo2024DTO) {
        SqlSession sqlSession = null;
        try {
            //使用批处理
            sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
            WpCjPwinfosj2024DTOMapper wpzfpwinfoMapper = sqlSession.getMapper(WpCjPwinfosj2024DTOMapper.class);
            wpcjPjinfo2024DTO.stream().forEach(pwinfo2024DTO -> wpzfpwinfoMapper.insert(pwinfo2024DTO));
            sqlSession.commit();
            return true;
        } catch (Exception ex) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            ex.printStackTrace();
            return false;
        } finally {
            // 确保SqlSession被关闭
            if (sqlSession != null) {
                sqlSession.close();
            }
        }
    }

    @Transactional
    public boolean InsertBatchdkxxb(List<WpCjDkxxb2024DTO> dkxxb2024DTOList) {
        SqlSession sqlSession = null;
        try {
            //使用批处理
            sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
            WpCjDkxxb2024DTOMapper dkxxbMapper = sqlSession.getMapper(WpCjDkxxb2024DTOMapper.class);
            dkxxb2024DTOList.stream().forEach(dkxxbDao -> dkxxbMapper.insert(dkxxbDao));
            sqlSession.commit();
            return true;
        } catch (Exception ex) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            ex.printStackTrace();
            return false;
        } finally {
            // 确保SqlSession被关闭
            if (sqlSession != null) {
                sqlSession.close();
            }
        }
    }

    @Transactional
    public boolean InsertBatch2nd(List<WpCjFjinfo2024DTO> wpcjFjinfo2024DTO) {
        SqlSession sqlSession = null;
        try {
            //使用批处理
            sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
            WpCjFjinfo2024DTOMapper wpzffjinfoMapper = sqlSession.getMapper(WpCjFjinfo2024DTOMapper.class);
            wpcjFjinfo2024DTO.stream().forEach(fjinfo2024DTO -> wpzffjinfoMapper.insert(fjinfo2024DTO));
            sqlSession.commit();
            return true;
        } catch (Exception ex) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            ex.printStackTrace();
            return false;
        } finally {
            // 确保SqlSession被关闭
            if (sqlSession != null) {
                sqlSession.close();
            }
        }
    }

    @Transactional
    public boolean InsertBatch3nd(List<WpCjPwinfo2024DTO> wpcjPjinfo2024DTO) {
        SqlSession sqlSession = null;
        try {
            //使用批处理
            sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
            WpCjPwinfo2024DTOMapper wpzfpwinfoMapper = sqlSession.getMapper(WpCjPwinfo2024DTOMapper.class);
            wpcjPjinfo2024DTO.stream().forEach(pwinfo2024DTO -> wpzfpwinfoMapper.insert(pwinfo2024DTO));
            sqlSession.commit();
            return true;
        } catch (Exception ex) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            ex.printStackTrace();
            return false;
        } finally {
            // 确保SqlSession被关闭
            if (sqlSession != null) {
                sqlSession.close();
            }
        }
    }

    @Transactional
    public boolean InsertBatch1(List<WpCjDkxxbxj2023DTO> dkxxbxj2023DTOList) {
        SqlSession sqlSession = null;
        try {
            //使用批处理
            sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
            WpCjDkxxbxj2023DTOMapper dkxxbxjMapper = sqlSession.getMapper(WpCjDkxxbxj2023DTOMapper.class);
            dkxxbxj2023DTOList.stream().forEach(dkxxbDao -> dkxxbxjMapper.insert(dkxxbDao));
            sqlSession.commit();
            return true;
        } catch (Exception ex) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            ex.printStackTrace();
            return false;
        } finally {
            // 确保SqlSession被关闭
            if (sqlSession != null) {
                sqlSession.close();
            }
        }
    }

    @Transactional
    public boolean InsertBatch2(List<WpCjFjinfo2023DTO> wpcjFjinfo2023DTO) {
        SqlSession sqlSession = null;
        try {
            //使用批处理
            sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
            WpCjFjinfo2023DTOMapper wpzffjinfoMapper = sqlSession.getMapper(WpCjFjinfo2023DTOMapper.class);
            wpcjFjinfo2023DTO.stream().forEach(fjinfo2023DTO -> wpzffjinfoMapper.insert(fjinfo2023DTO));
            sqlSession.commit();
            return true;
        } catch (Exception ex) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            ex.printStackTrace();
            return false;
        } finally {
            // 确保SqlSession被关闭
            if (sqlSession != null) {
                sqlSession.close();
            }
        }
    }

    @Transactional
    public boolean InsertBatch3(List<WpCjPwinfo2023DTO> wpcjPjinfo2023DTO) {
        SqlSession sqlSession = null;
        try {
            //使用批处理
            sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
            WpCjPwinfo2023DTOMapper wpzfpwinfoMapper = sqlSession.getMapper(WpCjPwinfo2023DTOMapper.class);
            wpcjPjinfo2023DTO.stream().forEach(pwinfo2023DTO -> wpzfpwinfoMapper.insert(pwinfo2023DTO));
            sqlSession.commit();
            return true;
        } catch (Exception ex) {
            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
            ex.printStackTrace();
            return false;
        } finally {
            // 确保SqlSession被关闭
            if (sqlSession != null) {
                sqlSession.close();
            }
        }
    }

    private Random random = new Random();

    public String getValue1(String name, String tblx, String type) {
        String value = "";
        if (type.equals("wfsjyt")) {
            switch (name.substring(0, 2)) {
                case "05":
                    value = "商服用地";
                    break;
                case "06":
                    value = "工矿仓储用地";
                    break;
                case "07":
                    value = "住宅用地";
                    break;
                case "08":
                    value = "公共管理与公共服务用地";
                    break;
                case "09":
                    value = "特殊用地";
                    break;
                case "10":
                    value = "交通运输用地";
                    break;
                case "11":
                    value = "水域及水利设施用地";
                    break;
                case "12":
                    value = "其他土地";
                    break;
                default:
                    value = "AAA";
            }
            if (value.equals("AAA")) {
                if (tblx.equals("WFYD") && name.equals("LGY")) {
                    value = "林果业";
                }
                if (tblx.equals("WTYY") && name.equals("LGY")) {
                    value = "挖塘养鱼";
                }
            }
        }
        return value;
    }

    public String getValue(String name, String type) {
        String value = "";
        if (("").equals(name)) {
            return "";
        }
        if (type.equals("sjyt")) {
            switch (name) {
                case "01":
                    value = "1.已依法供地";
                    break;
                case "02":
                    value = "2.已依法取得先行用地手续";
                    break;
                case "03":
                    value = "3.已办理其他合法用地手续";
                    break;

            }
        }
        //pwlb
        //pzwhlxtwo
        else if (type.equals("pwlb")) {
            switch (name) {
                case "NYDZY":
                    value = "农转用";
                    break;
                case "TDGY":
                    value = "土地供应";
                    break;
                case "GYJSTD":
                    value = "国有建设用地";
                    break;
            }
        } else if (type.equals("pzwhlxtwo")) {
            switch (name) {
                case "GD":
                    value = "供地";
                    break;
                case "PD_FPC":
                    value = "分批次(国批)";
                    break;
                case "PD_DDXZ":
                    value = "单独选址(国批)";
                    break;
                case "PD_SSFA":
                    value = "实施方案(省批)";
                    break;
                case "PD_SQWT":
                    value = "授权委托(省批)";
                    break;
                case "PD_CSYD":
                    value = "城市用地(省批)";
                    break;

            }
        } else if (type.equals("pwly")) {
            switch (name) {
                case "1":
                    value = "备案批文";
                    break;
                case "2":
                    value = "自录批文";
                    break;
                case "3":
                    value = "套合批文";
                    break;

            }
        } else if (type.equals("wf_xmlx")) {
            switch (name) {
                case "1":
                    value = "国家重点项目";
                    break;
                case "2":
                    value = "省重点工程";
                    break;
                case "3":
                    value = "其他项目";
                    break;

            }
        } else if (type.equals("clfs")) {
            switch (name) {
                case "1":
                    value = "立案";
                    break;
                case "2":
                    value = "非立案";
                    break;
                case "3":
                    value = "移交其他部门处理";
                    break;
                case "4":
                    value = "未处理";
                    break;
            }
        } else if (type.equals("tbfl")) {
            switch (name) {
                case "1":
                    value = "新增非农建设类";
                    break;
                case "2":
                    value = "其他新增建设类";
                    break;
                case "3":
                    value = "其他变化类";
                    break;
                case "4":
                    value = "年度内持续变化类";
                    break;
            }
        } else if (type.equals("pdlx")) {
            switch (name) {
                case "HFYD":
                    value = "符合法律法规和相关政策用地";
                    break;
                case "WFYD":
                    value = "不符合法律法规和相关政策用地";
                    break;
                case "QTYD":
                    value = "其他用地";
                    break;
            }
        } else if (type.equals("sjyt2")) {
            switch (name) {
                case "0301":
                    value = "已依法取得不动产权证书（含土地使用权证等）的图斑或地块";
                    break;
                case "0302":
                    value = "符合增减挂钩、工矿废弃地复垦利用等政策并办理了相应手续的图斑或地块";
                    break;
                case "0303":
                    value = "依据有审批权限的省级以上人民政府相关特殊政策，已取得相关用地文件的图斑或地块";
                    break;
            }
        } else if (type.equals("wfxwxmlxmc")) {
            switch (name) {
                case "1":
                    value = "国家重点项目";
                    break;
                case "2":
                    value = "省重点工程";
                    break;
                case "3":
                    value = "其他项目";
                    break;
            }
        } else if (type.equals("sfjjxm")) {
            switch (name) {
                case "Y":
                    value = "是";
                    break;
                case "N":
                    value = "否";
                    break;
            }
        } else if (type.equals("tbjsqk")) {
            switch (name) {
                case "BN":
                    value = "本年度新建";
                    break;
                case "WN":
                    value = "往年已建设";
                    break;
            }
        } else if (type.equals("sfylwsss")) {
            switch (name) {
                case "Y":
                    value = "是";
                    break;
                case "N":
                    value = "否";
                    break;
            }
        } else if (type.equals("qtydsjyt")) {
            switch (name) {
                case "101":
                    value = "设施农业用地";
                    break;
                case "102":
                    value = "临时用地";
                    break;
                case "105":
                    value = "农村道路";
                    break;
                case "106":
                    value = "不改变原用地性质的光伏用地";
                    break;
                case "107":
                    value = "实地未变化";
                    break;
            }
        } else if (type.equals("hfsjyt")) {
            switch (name) {
                case "05":
                    value = "商服用地";
                    break;
                case "06":
                    value = "工矿仓储用地";
                    break;
                case "07":
                    value = "住宅用地";
                    break;
                case "08":
                    value = "公共管理与公共服务用地";
                    break;
                case "09":
                    value = "特殊用地";
                    break;
                case "10":
                    value = "交通运输用地";
                    break;
                case "11":
                    value = "水域及水利设施用地";
                    break;
                case "12":
                    value = "其他土地";
                    break;
            }
        } else if (type.equals("hfsjyt2j")) {
            switch (name) {
                case "05H1":
                    value = "商业服务业设施用地";
                    break;
                case "0508":
                    value = "物流仓储用地";
                    break;
                case "0601":
                    value = "工业用地";
                    break;
                case "0602":
                    value = "采矿用地";
                    break;
                case "0701":
                    value = "城镇住宅用地";
                    break;
                case "0702":
                    value = "农村宅基地";
                    break;
                case "08H1":
                    value = "机关团体新闻出版用地";
                    break;
                case "08H2":
                    value = "科教文卫用地";
                    break;
                case "0809":
                    value = "公用设施用地";
                    break;
                case "0810":
                    value = "公园与绿地";
                    break;
                case "09":
                    value = "特殊用地";
                    break;
                case "1001":
                    value = "铁路用地";
                    break;
                case "1002":
                    value = "轨道交通用地";
                    break;
                case "1003":
                    value = "公路用地";
                    break;
                case "1004":
                    value = "城镇村道路用地";
                    break;
                case "1005":
                    value = "交通服务场站用地";
                    break;
                case "1006":
                    value = "农村道路";
                    break;
                case "1007":
                    value = "机场用地";
                    break;
                case "1008":
                    value = "港口码头用地";
                    break;
                case "1009":
                    value = "管道运输用地";
                    break;
                case "1103":
                    value = "水库水面";
                    break;
                case "1109":
                    value = "水工建筑用地";
                    break;
                case "1201":
                    value = "空闲地";
                    break;
            }
        } else if (type.equals("wflx1")) {
            switch (name) {
                case "100000":
                    value = "非农化违法用地";
                    break;
                case "4000000":
                    value = "非粮化违法违规用地";
                    break;
            }
        } else if (type.equals("wflx2")) {
            switch (name) {
                case "110000":
                    value = "新增非农建设违法用地";
                    break;
                case "120000":
                    value = "存量非农建设违法用地";
                    break;
                case "4010000":
                    value = "农业设施建设违法违规用地";
                    break;
                case "4020000":
                    value = "涉及发展林果业和挖塘养鱼等违法用地";
                    break;
            }
        } else if (type.equals("zglsdwqk")) {
            switch (name) {
                case "SWZGLS":
                    value = "尚未整改落实";
                    break;
                case "CCFG":
                    value = "拆除复耕";
                    break;
                case "BBSX":
                    value = "补办手续";
                    break;
                case "YJQTBM":
                    value = "移交其他部门处理";
                    break;
                case "CCFG,BBSX":
                    value = "拆除复耕,补办手续";
                    break;
            }
        } else if (type.equals("wflx3")) {
            switch (name) {
                case "110300":
                    value = "1.违法占地";
                    break;
                case "110200":
                    value = "2.违法供地";
                    break;
                case "110100":
                    value = "3.违法批准占用";
                    break;
                case "110400":
                    value = "4.未供即用";
                    break;
                case "120101":
                    value = "在存量建设用地上存在的违反国土空间规划的翻新、翻建、新建行为";
                    break;
                case "4010100":
                    value = "1.占用永久基本农田建设畜禽养殖设施、水产养殖设施";
                    break;
                case "4010200":
                    value = "2.占用永久基本农田建设破坏耕作层的种植业设施";
                    break;
                case "4010300":
                    value = "3.占用永久基本农田建设农村道路";
                    break;
                case "4010400":
                    value = "4.未经批准或不符合相关标准占用一般耕地建设畜禽养殖、水产养殖设施";
                    break;
                case "4010500":
                    value = "5.未经批准或不符合相关标准占用一般耕地建设破坏耕作层的种植业设施";
                    break;
                case "4010600":
                    value = "6.符合相关标准但未经批准占用一般耕地建设农村道路";
                    break;
                case "4020100":
                    value = "非法占用永久基本农田发展林果业";
                    break;
                case "4020200":
                    value = "非法占用永久基本农田发展挖塘养鱼";
                    break;

            }
        } else if (type.equals("wflx4")) {
            switch (name) {
                case "110101":
                    value = "1.无权批准征收、使用土地的单位或者个人非法批准占用土地的";
                    break;
                case "110102":
                    value = "2.超越批准权限非法批准占用土地的";
                    break;
                case "110103":
                    value = "3.违反法律规定程序批准占用、征收土地的";
                    break;
                case "110104":
                    value = "4.不按照国土空间规划确定的用途批准用地的";
                    break;
                case "110105":
                    value = "5.不符合临时用地使用范围和使用条件，违法违规进行审批";
                    break;
                case "110201":
                    value = "1.依法办理农转征或建新方案审批手续后，违反法律法规规定的方式或程序供地";
                    break;
                case "110301":
                    value = "1.卫片图斑下发时占用的土地，用地者未申报用地报批手续的";
                    break;
                case "110302":
                    value = "2.虽已批准但因新增建设用地有偿使用费缴纳等各种原因未能取得批准文件的";
                    break;
                case "110303":
                    value = "3.采取欺骗手段骗取批准的";
                    break;
                case "110304":
                    value = "4.虽经批准但属于超过批准数量多占的部分";
                    break;
                case "110305":
                    value = "5.占用耕地建窑、建坟或者擅自在耕地上建房、挖砂、采石、采矿、取土等，破坏种植条件的";
                    break;
                case "110306":
                    value = "6.先行用地批准文件有效期满后续建的";
                    break;
                case "110307":
                    value = "7.已经取得临时用地批准文件，但未按照批准内容进行临时建设的";
                    break;
                case "110308":
                    value = "8.临时用地超出复垦期限未完成土地复垦的";
                    break;
                case "110309":
                    value = "9.假借农业设施项目名义，实施非农建设的";
                    break;
                case "110310":
                    value = "10.对往年已形成的历史违法用地，且未曾纳入土地卫片执法范围的";
                    break;
                case "110311":
                    value = "11.对已服务农业生产为名，主要用于停车场、农村健身等用途但未办理建设用地审批手续的";
                    break;
                case "110312":
                    value = "12.对赛鸽、赛马等比赛场地及关联的办公、驯养等附属设施，未办理建设用地审批手续的";
                    break;
                case "110401":
                    value = "1.卫片图斑下发时，已依法办理农转用手续，但未办理供地手续，即开始占用土地";
                    break;

            }
        } else if (type.equals("qtydsjyt2")) {
            switch (name) {
                case "10701":
                    value = "1.属于国务院其他有关部门管理范围";
                    break;
                case "10702":
                    value = "2.涉及海域使用";
                    break;
                case "10703":
                    value = "3.旅游项目用地";
                    break;
                case "10704":
                    value = "4.建设农田水利设施与农业简易棚（房）";
                    break;
                case "10705":
                    value = "5.土地整理";
                    break;
                case "10706":
                    value = "9.地上种植物调整";
                    break;
                case "10707":
                    value = "10.因农业结构调整产生的农用地内部用途调整";
                    break;
                case "10708":
                    value = "11.建设用地和未利用地转变为农用地";
                    break;
                case "10709":
                    value = "12.边坡治理";
                    break;
                case "10710":
                    value = "13.房屋拆迁（征收）";
                    break;
                case "10711":
                    value = "14.地下管网（廊）建设";
                    break;
                case "10712":
                    value = "15.边角地堆弃土";
                    break;
                case "10713":
                    value = "16.紧急用地";
                    break;
                case "10714":
                    value = "17.灾毁地";
                    break;
                case "10715":
                    value = "18.合法矿区范围内非实质性建设";
                    break;
                case "10716":
                    value = "20.因卫片监测技术问题错误提取";
                    break;
                case "10717":
                    value = "21.其他经省级自然资源主管部门认定，依法依规无需办理新增建设用地审批手续";
                    break;
                case "10718":
                    value = "6.部批复的全域土地综合整治试点已得到省级有关部门批准的实施方案，且不涉及非农建设";
                    break;
                case "10719":
                    value = "7.农村道路翻新形成";
                    break;
                case "10720":
                    value = "8.占用除农用地以外的土地进行生态修复项目建设形成";
                    break;
                case "10721":
                    value = "19.往年已形成且在土地卫片执法中被判定为违法用地的历史违法用地，且未发生新的违法行为";
                    break;
            }
        } else if (type.equals("wfsjyt2j")) {
            switch (name) {
                case "05H1":
                    value = "商业服务业设施用地";
                    break;
                case "508":
                    value = "物流仓储用地";
                    break;
                case "601":
                    value = "工业用地";
                    break;
                case "602":
                    value = "采矿用地";
                    break;
                case "701":
                    value = "城镇住宅用地";
                    break;
                case "702":
                    value = "农村宅基地";
                    break;
                case "08H1":
                    value = "机关团体新闻出版用地";
                    break;
                case "08H2":
                    value = "科教文卫用地";
                    break;
                case "0809":
                    value = "公用设施用地";
                    break;
                case "0810":
                    value = "公园与绿地";
                    break;
                case "09":
                    value = "特殊用地";
                    break;
                case "1001":
                    value = "铁路用地";
                    break;
                case "1002":
                    value = "轨道交通用地";
                    break;
                case "1003":
                    value = "公路用地";
                    break;
                case "1004":
                    value = "城镇村道路用地";
                    break;
                case "1005":
                    value = "交通服务场站用地";
                    break;
                case "1006":
                    value = "农村道路";
                    break;
                case "1007":
                    value = "机场用地";
                    break;
                case "1008":
                    value = "港口码头用地";
                    break;
                case "1009":
                    value = "管道运输用地";
                    break;
                case "1103":
                    value = "水库水面";
                    break;
                case "1109":
                    value = "水工建筑用地";
                    break;
                case "1201":
                    value = "空闲地";
                    break;
                case "LGY":
                    value = "林果业";
                    break;
                case "WTYY":
                    value = "挖塘养鱼";
                    break;
                case "1202":
                    value = "设施农用地";
                    break;
            }
        }
        return value;
    }
}
